添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
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.
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
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.
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.
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
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
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

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