View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Inter-program communication using SendKeys

Hi Tim,
IE takes time to open and load the page. Shell just dumps to the command prompt so you need to find a way to wait for IE fully open before sending sendkey commands.

A better method is to control IE from within your VBA code.
There is some info here that should get you started.
http://www.google.com/groups?hl=en&l...6btnG%3DSearch


--

John
johnf202 at hotmail dot com


"Tim Coddington" wrote in message ...
Trying to figure out how to manipulate an instance of explorer from VBA.
Tried the following, but get a

"Run-time error '5':
Invalid proceedure call or argument"

on the AppActivate line.


Sub TryIt()
Dim ieAlphaTrade, ieAmeritrade As Double

ieAlphaTrade = Shell("C:\Program Files\Internet Explorer\iexplore.exe",
vbNormalFocus)
AppActivate ieAlphaTrade, True
End Sub

Tried a DoEvents before the AppActivate, and that seemed to help a little,
but the error came back.

Any hints?

Thanks in advance,
-Tim