Consulting

Results 1 to 10 of 10

Thread: Control Firefox browser

  1. #1
    VBAX Regular
    Joined
    Nov 2006
    Posts
    41
    Location

    Control Firefox browser

    Hello,

    I am trying to manipulate opening up several windows using Firefox browser. I would like to have each brower window completely load before macro moves on. Below is code that I can use to open IE browser & loop until browser is fully loaded. Can someone show me how to do this specifying Firefox browser?

    [VBA]


    Sub test()
    Dim IeApp As InternetExplorer
    Dim sURL As String
    On Error GoTo endStartup

    With application

    Set IeApp = New InternetExplorer

    IeApp.Visible = True
    sURL = "http://cnn.com"

    IeApp.navigate sURL

    Do
    Loop Until IeApp.ReadyState = READYSTATE_COMPLETE

    Set IeApp = Nothing
    End With

    [/VBA]

  2. #2
    VBAX Mentor
    Joined
    Dec 2007
    Posts
    462
    Location
    check out your firefox browser name and change Dim IEApp as filefox,
    by default it is probably Moziila firefox so try Dim IEApp as "Mozilla Firefox" or replace the as with the full path name to the firefox exe. and it should work

  3. #3
    VBAX Regular
    Joined
    Nov 2006
    Posts
    41
    Location
    Hi Trevor,

    Thanks for your suggestions.

    I tried both with no luck...but I probably didn't enter correctly. I tried "Mozilla Firefox", "Mozilla" and "Firefox" with no luck...below I tried the full path, but I keep getting a mismatch type error or expected end of statement error.

    [VBA]

    Dim IEApp As WebBrowser
    Dim sURL As String
    On Error GoTo endStartup

    With Application

    Set IEApp = "C:\Program Files\Mozilla Firefox\firefox.exe"

    IEApp.Visible = True
    sURL = "http://www.cnn.com"

    IEApp.navigate sURL

    Do
    Loop Until IEApp.ReadyState = READYSTATE_COMPLETE

    Set IEApp = Nothing
    End With
    End Sub
    [/VBA]


    Thanks

  4. #4
    VBAX Mentor
    Joined
    Dec 2007
    Posts
    462
    Location
    ok to open it this I Know has to work because I use it to open Outlook and then use send keys
    Dim stappname1 As string
    stAppName1 = "fulll path to filefox.exe"
    Call Shell(stAppName1, 1)
    (the rest of your script here)
    End sub

  5. #5
    VBAX Mentor
    Joined
    Dec 2007
    Posts
    462
    Location
    I just noticeted in your code "on error goto endStartup"
    but I don't see it in your code you have posted so I hope you have that routine in your code and that you just chose not to post that part, if you need help with it let me know

  6. #6
    VBAX Mentor
    Joined
    Dec 2007
    Posts
    462
    Location
    It just ocurred to me, are youe trying to controle brower windows from within Firefox or from an external program , if you are trying to do it from within Firefox look at mozilla.org for controlling browing, you will have a better result that way, I use to use firefox when I had XP but I have problems with the flash player plugin for firefox on vista , so I'm stuck waiting for the plug in problem to be fixed .

  7. #7
    VBAX Regular
    Joined
    Nov 2006
    Posts
    41
    Location
    Hi Trevor,

    I probably didn't give enough detail on what I am trying to do. My default browser is IE but I've created a form where certain URL addresses must be pulled up in Firefox browser. I would like to have the same type of control with Firefox browser as I do with IE....example:

    Loop Until IEApp.ReadyState = READYSTATE_COMPLETE

    Multiple webpages might be pulled up at same time in seperate windows. I would like each page to completely load before the macro continues to open the next URL...and so on.

    Thanks

  8. #8
    VBAX Mentor
    Joined
    Dec 2007
    Posts
    462
    Location
    ok , curious, why pull urls from firefox when IE is your default browser?
    but I would have to say to get the same controle with firefox because there are serveral versions, I would suggest checkout the firefox forums for those controle names, you may need to make a reference under tools>>references in your coding section to firefox and if you read those files in that refference, you can find oue what the controle name are for firefox, if you check out the firefox forums there are .css files that you may want to edit to change displace , behaivior charactoristics .

  9. #9
    VBAX Regular
    Joined
    Nov 2006
    Posts
    41
    Location
    My form directs the user to URL addresses that are a geographical user interface not compatible with IE....only with Netscape and Firefox. So I would like to keep IE as my default but have the form use Firefox when those addresses are called.

    Thanks for the suggestion....i will certainly see what I can find. If I am successful, I will post my results.

    Croeg

  10. #10
    VBAX Mentor
    Joined
    Dec 2007
    Posts
    462
    Location
    got some more info for you since mozilla fixed the flshplayer bug with Firefox check out .... in your address for firefox About:config and those are the configurations you can change though the about config you can do more by editing usercontent.css and user.js.
    note to save you time if you manualy start a new tab you will get a blank page because of a bug since v1.5 that hasn't been fixed so you can not controle on brower.tab onnewload but the workaround is to middle click(push scroll wheel down) on the home icon and that will open a new tab w/ your home page. http://kb.mozillazine.org/Firefox_:_...config_Entries scroll down about 1/4 inch and you'll see a box "content" try that.
    I know u'll have to make a reference to Firefox in your tools>> refferences in your code section.
    I hope this helps more then, I've helped in the past Note i think if you set your homepage to a folder then onload all pages in that folder will load in seperat tabs, I don't know but that may make your job a little easier

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •