Activating mozilla firefox and entering an address

G

Geoff ML

what i want to to do is open and activate my firefox browser from excel, then
go to a website, select everything that is on the webpage and copy it to the
clipboard. the only way i can think to do this is using sendkeys. i am new to
VBA please help in laymans terms. the code i have so far, which does not
really work at all, is:

Sub SendKeysApp()

Dim Browser As Variant

Browser = Shell("C:\Program Files\Mozilla Firefox\firefox.exe", 1)
Application.Wait Now() + "00:00:02"
AppActivate Browser
SendKeys "^(F)", True
' supposed to activate the location bar but does not work either

End Sub

btw when i try to run this it says something is wrong with the
Application.Wait line: type mismatch?
 
F

FSt1

hi
the application.wait part has a format mismatch. the format for now() and
the + part are different and i think that is were you are getting the error
so the solutions is to get the time all in the same format.
from excel help.....
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 5
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

as to the send keys, i am very inexperieced on that. don't use them. sorry.

Regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top