I have an Excel spreadsheet with html links in one column. The links are being generated by a perl script via Win32::OLE like so (inside a 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 a lot of these links I wind up with 20 tabs after working with the sheet for a while. This is a pain in the behind because I periodically have to go through and close them.
Is there some way to get these links to open in the same browser tab? I don’t know if it’s possible to specify the HTML equivalent of an anchor target with a constant name using the Hyperlinks->Add method, or if this would even do the job.
Depends on which browser you are using:
For Firefox, see this link Force Firefox To Open Links In Same Tab
Requires setting option in
about:configbrowser.link.open_newwindow = 1For IE,
Tools/options/General/Tabs/Setings