VBA - FollowHyperlink function opening multiple tabs in Firefox

Naed1

New Member
Joined
Nov 15, 2013
Messages
26
Hi,

I am using the FollowHyperlink VBA function in Excel 2007 to bring up Web pages. It works but has a slight problem. I am using Firefox and it opens a new tab each time I execute the function. I would rather it bring up the Web page on the same tab each time the function is executed. I was using NewWindow:=True and changed it to NewWindow:=False (the default) but it still opens a new tab in Firefox each time the function is executed.

I am on a 32 bit Windows 7 Operating system. The code I am executing is shown below. The String Variable "Hyper" contains the URL I want to open.

Code:
ActiveWorkbook.FollowHyperlink Address:=Hyper, NewWindow:=False
 
I dont think you can control the behavior of the browser from VBA, instead you need to change how the browser behaves. The NewWindow option control whether a new browser session is created each time.

How does this behave in IE, I think you will have similar issues?

Take a look at this for changing how the browser handles external links, this may cause other consequences though that might change the browser behavior

Force Firefox To Open Links In Same Tab | Ghacks
 
Upvote 0
Thanks a Million!!!

I used the browser.link.open_newwindow.override.external in About:Config as mentioned at the bottom of the article and it works well, opening my external link on the same firefox tab. According to the article this should only occur now on external links.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top