View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Albert Albert is offline
external usenet poster
 
Posts: 203
Default Interaction and SendKeys

Hello.
I use an econometric program called Stata.
I want a procedure that sends a command to Stata's Command Window.
I have created one but it works sporadically. Perhaps someone has some
suggestions? Maybe an option that does not involve SendKeys?
Here's the code I'm using.

Dim ReturnValue
ReturnValue = Shell("C:\Stata9\wsestata.exe", vbMaximizedFocus)
VBA.Interaction.AppActivate ReturnValue, True
Application.SendKeys "This is the command to send to Stata"

Thanks!
Albert C