Using FireFox instead of IE for VBA web browsing

tx12345

Board Regular
Joined
Aug 28, 2006
Messages
165
hi

this is probably an easy one, but i want to use firefox instead of IE in my VBA macros

=======

sub whatever()

set ff = CreateObject("FireFox.Application")
with ff
get it done

etc
amen
end with
end sub
=========

i have hacked away at the create object statement but can't get firefox to, well, fire.

any thoghts?

tx

ps

a shout out to my homies at censorfreespeechquashthefreeexchangeofideas.com
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Search Google for XPCOM and then learn C++, Java, JS, or Python. There is no MS compatible COM component that I know of for FireFox. You will not be able to do this in VB.

CreateObject will only create an instance of and provide a reference to registered COM servers.
 
Upvote 0
Hi Guys

An interesting question which got me thinking.......

There is a Mozilla ActiveX Control available to download from here:
http://www.iol.ie/~locka/mozilla/control.htm

If you follow the instructions on that website it is pretty easy to install and it is compatiable with VBA (despite their website not listing it as compatible). The only way I have managed to use this control so far (in my 30 seconds of testing) is to create a user form with a huge Mozilla control and then use the following code for that form :
Code:
Private Sub UserForm_Activate()
Me.MozillaBrowser1.Navigate ("http://www.mrexcel.com/board2/viewtopic.php?p=1182388")
End Sub

This hasn't actually opened Firefox, it merely used a Firefox control on an Excel form.

Food for thought?

Andrew
 
Upvote 0
Was this ever resolved? I know this is an old thread but can't seem to find a way to use FireFox in place of InternetExplorer in VBA.
Currently using:
Code:
Public ie As Object
Set ie = CreateObject("internetexplorer.application")
Since MicroSoft makes Excel and Explorer, one can imagine why FireFox might not get to just jump into the code there as this more recent MrExcel link suggests.
http://www.mrexcel.com/forum/excel-...ox-using-macro-visual-basic-applications.html
It would be nice if one could do some form of the following:
Code:
Set ie = CreateObject("firefox.application")
Has anyone found a solution?
Thanks.
 
Upvote 0
hi, i have a couple of items that may work as a work around. (my problem was how to select, the current / active? webpage), please excuse if i am off track on what you need/ am a bit novice at vb.
i have a couple of subs for the following that i will include. with my problem of selecting the web page & staying there i think just inserting a line for screenupdating off in the right place fixed that.
using a timer after activate a hyperlink helped that take effect.
EG: J6 shows: BM:BM by using workcell J6 with a dynamic reference: =SUBSTITUTE(SUBSTITUTE(CELL("address",$BM6),"$",""),ROW(),"")&":"&SUBSTITUTE(SUBSTITUTE(CELL("address",$BM6),"$",""),ROW(),"")
this assumes a column with hyperlinks adjusted by formula.. for each line:
=HYPERLINK($BM$4&BH905,IF(P905>0,"O","A"))

This code is not differing from IE or FF. just hoped you might find a work around for what doing. thanks.

Code:
sub goLINK()
    Dim J6 As String    'home
    J6 = RANGE("J6")

    Application.CutCopyMode = False   'see findmin, does not do 2 things in 1 row

                Cells(ActiveCell.row, J6).Select                'open hyperlink gocharts0,  SEE: J6J6,  if 0 result of dl: p1 range of cells selected
                'line above activates vb: goFHL (as below)
                RANGE("A1") = vbNullString: goTIMER (2)         'a1 simple macros on-off technique, just stopping some other cursor jumps i have prog'd in
                
                Application.ScreenUpdating = False              '<<  UPDATE OFF  screen jump  <<    USED HERE seems to stop workbook/ webpage selection toggling for mulitple windows..
                
              If UCase(RANGE(G3).OFFSET(2, 0)) = "X" Or UCase(RANGE(G3).OFFSET(2, 0)) = "XX" Then
                'do nothing
              Else
                Cells(ActiveCell.row, J6).OFFSET(, 1).Select    'HIST
                goFHL ActiveCell.Formula, ",IF(": goTIMER (2)
              End If
                Cells(ActiveCell.row, J6).OFFSET(, 2).Select    'OTC sym changes/ splits
                goFHL ActiveCell.Formula, ",IF("                'prob: if change friend name, change these
                RANGE("A1") = ".": goHOME

    Application.CutCopyMode = False           'getting paste status from dif wb
    Application.EnableEvents = True           'EVENTS
'findzero() FINDZERO()
End Sub




'goFHL  follow hyperlink vb:  excuse notes..

Sub goFHL(strF As String, strDL As String)        'GOFHLXXX gofhlxxx  255 chars AS:  goFHL ActiveCell.Formula, ",friendlyname"
    Dim V As Variant                              'follow HYPERLINK AS: (left of friendly name):  goFHL ActiveCell.Formula, ",IF("
    'enter quotes as string ANS:  either double up on quotes:
    'goFHL ActiveCell.Formula, ",""SAM"""         'for: ,"SAM"    OR USE:  & CHR(34) &
    'goFHL ActiveCell.Formula, "," & CHR(34) & "SAM" & CHR(34)
    
    If InStr(1, strF, "HYPERLINK") = 0 Or InStr(1, strF, strDL) = 0 Then
      Application.EnableEvents = True: Exit Sub         'EVENTS
    End If
    V = split(strF, strDL)
    On Error Resume Next
    ActiveWorkbook.FollowHyperlink Application.Evaluate(Replace(V(0), "HYPERLINK(", ""))
    Application.EnableEvents = True               'EVENTS
'gofhl() GOFHL()
End Sub



Sub goTIMER(NumOfSeconds As Long) '(in seconds eg: 0.5) as:  gotimer (1)  'seconds
    Application.wait now + NumOfSeconds / 86400#
    Application.EnableEvents = True               'EVENTS
End Sub   'gotimer() GOTIMER()



Sub goHOME()            'call as:  call gohome
    Dim D2 As String    'home
    D2 = RANGE("D2")

        Cells(ActiveCell.row, D2).Select            'home
end sub
 
Upvote 0

Forum statistics

Threads
1,215,337
Messages
6,124,340
Members
449,155
Latest member
ravioli44

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