Re: Shell - then Send Keys
Welcome to the forums :wave:
SendKeys was created to do just was it says...Send Keys, or more accurately, Keystrokes.
You are trying to send data...text...whole sentences, and that ain't gonna work.
If you want to send a Tab key, or one of the Function Keys, or something along those lines, then you are in SendKeys' baliwick.
Perhaps this might shed more light.
Re: Shell - then Send Keys
BTW - not trying to send data, text, whole sentences - need to be able to automatically navigate through a series or windows and prompts in my "outside" application...based upon the results calculated in my access db.
Re: Shell - then Send Keys
Maybe I mis-titled the thread -
It is not the actual send keys function I am having problems with (as I have done this before on a pcomm type application and it works great).
I am having problems setting the focus on the window of the application VB has just opened - if i can get that to work - the rest of this project would be fairly easy. Any Ideas?
Re: Shell - then Send Keys
i use appactivate, with inline error handling, to make sure the shelled window is open and has focus before trying to sendkeys
i do not have problem sending text strings to other windows
as i use vb6 the code may need modifying slightly
vb Code:
apptitle = "Untitled - Notepad"
r = shell("notepad.exe")
on error resume next
do
err.clear
appactivate apptitle
do events
loop while not err.number = 0
on error goto 0 ' return to previous error handling
sendkeys vbnewline