How to get links in Excel to open in one browser tab

I have an Excel spreadsheet with html links in one column. Links are generated by the perl script through the Win32::OLEsame way (inside the loop with index $ i):

my $range = $Sheet->Range("B".$row);
my $link = "http://foobar.com/show.pl?id=$i";
$Sheet->Hyperlinks->Add({Anchor=>$range,Address=>$link,TextToDisplay=>"Link to $i"});

Currently, every time I click one of these links, it opens in a new browser tab. Since there are many of these links, I am finishing work with 20 tabs after working with the sheet for a while. It’s a pain in the back because I periodically have to go through and close them.

Is there a way to open these links in one browser tab? I do not know if it is possible to specify the HTML equivalent of an anchor target with a constant name using the method Hyperlinks->Add, or even if it will complete the task.

+3
source share
3

, :

Firefox . Firefox

about:config browser.link.open_newwindow = 1

IE, Tools/options/General/Tabs/Setings

Open links from other programs in: The current Tab or Window
+1

: WriteExcel

#!/usr/bin/perl -w
use strict;
use Spreadsheet::WriteExcel;

# Create a new workbook called simple.xls and add a worksheet
my $workbook  = Spreadsheet::WriteExcel->new('Example.xls');
my $worksheet = $workbook->add_worksheet();

# The general syntax is write($row, $column, $token). Note that row and
# column are zero indexed
# Write a hyperlink
$worksheet->write(10, 0, 'http://perldoc.perl.org/');
$worksheet->write(11, 0, 'http://stackoverflow.com/');

__END__  

( IE, Firefox, Chrome)

+1

So, I found documents for the Excel object model, and there are no hyperlink properties that would indicate that this is possible. Thanks for the help.

0
source

All Articles