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.
 
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/excel-questions/"
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

Thanks Kenneth! Plz help me! How to hidden firefox when code running! ( With IE i can use: IE.visble = fasle)! Thanks for your help!
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,215,064
Messages
6,122,939
Members
449,094
Latest member
teemeren

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