PDA

View Full Version : Control Firefox browser



Croeg
02-15-2008, 06:52 PM
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?




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

Trevor
02-18-2008, 04:34 PM
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

Croeg
02-18-2008, 05:35 PM
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.



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



Thanks

Trevor
02-18-2008, 09:05 PM
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

Trevor
02-18-2008, 09:07 PM
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

Trevor
02-18-2008, 09:17 PM
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 .

Croeg
02-19-2008, 03:24 AM
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

Trevor
02-19-2008, 12:51 PM
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 .

Croeg
02-19-2008, 08:45 PM
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.

:thumb Croeg

Trevor
02-19-2008, 09:42 PM
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_:_FAQs_:_About: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