Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Interaction and SendKeys

Using send keys is generally unreliable. Does Stata have an API allowing you
to interface with the program?
--
HTH...

Jim Thomlinson


"Albert" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Interaction and SendKeys

Hello Jim.
Unfortunately I've found no DLL or API. There is only a .exe, but when I try
to make the reference in VBA, I get a "Can't make reference to that file"
message.


"Jim Thomlinson" wrote:

Using send keys is generally unreliable. Does Stata have an API allowing you
to interface with the program?
--
HTH...

Jim Thomlinson


"Albert" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interaction between 2 UserForms excelnut1954 Excel Programming 2 May 10th 06 09:36 PM
Personal vba - interaction xls/xlt Zurn[_38_] Excel Programming 2 April 6th 06 02:18 PM
... interaction with Word ... Dr. Darrell Excel Discussion (Misc queries) 2 July 21st 05 10:42 PM
Web interaction Nigel[_6_] Excel Programming 3 February 20th 04 08:34 AM
UserForm Interaction Bob Phillips[_5_] Excel Programming 0 September 22nd 03 08:12 PM


All times are GMT +1. The time now is 01:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"