ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Activating mozilla firefox and entering an address (https://www.excelbanter.com/excel-programming/413594-activating-mozilla-firefox-entering-address.html)

Geoff ML[_2_]

Activating mozilla firefox and entering an address
 
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?

FSt1

Activating mozilla firefox and entering an address
 
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

"Geoff ML" wrote:

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?



All times are GMT +1. The time now is 12:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com