Opening url in Firefox from Excel

kingofaces

Board Regular
Joined
Aug 23, 2010
Messages
68
This may be beyond what VBA is capable of in excel, but I figured it was worth a shot. Basically I have a list of full urls I have in a spreadsheet. I keep it as a sort of list of bookmarks instead of in Firefox so that I can easily click the url, go back to Excel, and enter info associated with that link. Problem is that when I click on the hyperlink in Excel, the website redirects me. However, if I just copy and paste the url directly into Firefox, it works perfectly fine.

I know VBA can be used to open Internet Explorer, but can the same be done with Firefox? More specifically I'd like to open a new tab at the url. It sounds like it might be borderline doable, but I have a little hope since it's pretty basic still. Any thoughts are appreciated. Thanks.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
You can use Shell. The command line parameters are at: http://kb.mozillazine.org/Command_line_arguments

There are several ways to play the Shell command as with any macro.

e.g.
Code:
Sub Test_OpenFireFoxNewTab()
  OpenInFireFoxNewTab "http://www.mrexcel.com/forum/forumdisplay.php?f=10"
End Sub

Sub OpenInFireFoxNewTab(url As String)
  Dim pathFireFox As String
  pathFireFox = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
  If Dir(pathFireFox) = "" Then pathFireFox = "C:\Program Files\Mozilla Firefox\firefox.exe"
  If Dir(pathFireFox) = "" Then
    MsgBox "FireFox Path Not Found", vbCritical, "Macro Ending"
    Exit Sub
  End If
  Shell """" & pathFireFox & """" & " -new-tab " & url, vbHide
End Sub
 
Upvote 0
Thanks Kenneth, that did the trick. I didn't realize it would be that straightforward. I had gathered (much earlier posts probably) that you couldn't do much manipulation of browsers through excel, but that doesn't seem to be the case here at least.

Noire, FF currently is my default browser. I'm not sure what was going on, but clicking a link in excel to this website caused it to redirect, while other websites worked just fine. This gets around that at least.

Thanks all.
 
Upvote 0
Glad you got it sorted.

I was going to suggest you check the settings in whatever browser was the default.
 
Upvote 0
Can this technique also be used to replace the default browser used for importing data from the web? There's a website we normally import data from that updated to exclude access via IE 7. I'm on IE 11, but I can't get the default browser for the Import From Web function to update.
 
Upvote 0
Hello Kenneth,


Thank you very very very muchhh..You made my day!

Actully I was looking for this solution since long time for my VB project.I had spent days and nights on seraching the solution but no other solution worked for me.

It was your solution which worked for me.
Thank You once again!

Regards
Pramod Pol

You can use Shell. The command line parameters are at: Command line arguments - MozillaZine Knowledge Base

There are several ways to play the Shell command as with any macro.

e.g.
Code:
Sub Test_OpenFireFoxNewTab()
  OpenInFireFoxNewTab "http://www.mrexcel.com/forum/forumdisplay.php?f=10"
End Sub

Sub OpenInFireFoxNewTab(url As String)
  Dim pathFireFox As String
  pathFireFox = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
  If Dir(pathFireFox) = "" Then pathFireFox = "C:\Program Files\Mozilla Firefox\firefox.exe"
  If Dir(pathFireFox) = "" Then
    MsgBox "FireFox Path Not Found", vbCritical, "Macro Ending"
    Exit Sub
  End If
  Shell """" & pathFireFox & """" & " -new-tab " & url, vbHide
End Sub
 
Upvote 0
Hello Kenneth,


Thank you very very very muchhh..You made my day!

Actully I was looking for this solution since long time for my <acronym title="vBulletin" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VB</acronym> project.I had spent days and nights on seraching the solution but no other solution worked for me.

It was your solution which worked for me.
Thank You once again!

Regards
Pramod Pol
 
Upvote 0
Gentlemen
I have this macro that allows me to navigate to a site with the address placed in a textbox (named tbEnderecoweb) and capture data with Internet Explorer, but would like to use firefox to be able to do this.

Sub ReadNet()
Dim IE As Object


Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
'.Visible = False

.Navigate TBEnderecoWeb

Do Until .ReadyState = 4: DoEvents: Loop
End With

IE.ExecWB 17, 0 '// SelectAll
IE.ExecWB 12, 2 '// Copy selection

IE.Quit
End Sub


Can anybody help me?
Thank you
greetings
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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