PC Review


Reply
Thread Tools Rate Thread

Activating mozilla firefox and entering an address

 
 
Geoff ML
Guest
Posts: n/a
 
      5th Jul 2008
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?
 
Reply With Quote
 
 
 
 
FSt1
Guest
Posts: n/a
 
      5th Jul 2008
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?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox can't import older Mozilla/Firefox favorites jbclem Microsoft Windows 2000 2 9th Mar 2007 02:36 AM
Mozilla Firefox Katie43 Windows XP Basics 18 4th Nov 2005 07:36 AM
Will Mozilla/Mozilla Firefox work on Windows 95? Chaos Master Freeware 7 27th Jun 2004 08:31 PM
OT: Mozilla Firebird -> Mozilla Firefox! KenKnightJack Windows XP Help 1 10th Feb 2004 06:56 PM
OT: Mozilla Firebird -> Mozilla Firefox! KenKnightJack Windows XP General 1 10th Feb 2004 06:56 PM


Features
 

Advertising
 

Newsgroups
 


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