Thread: SendKeys
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Arnie Arnie is offline
external usenet poster
 
Posts: 65
Default SendKeys

Thanks Joel :-)

"Joel" wrote:

Try this code. It opens a Notepad application using your filename and then
sends the key to the active window.

Sub test()
FName = "C:\Documents and Settings\Fred_Bloggs\" & _
"My Documents\Folder1\Folder2\AnyThing.txt"

MyAppID = Shell("notepad.exe" & FName, 1) ' Run Microsoft Word.
AppActivate MyAppID ' Activate Microsoft

SendKeys "{Enter}", Wait:=True

End Sub


"Arnie" wrote:

can anyone help i am using

SendKeys "C:\Documents and Settings\Fred_Bloggs\My
Documents\Folder1\Folder2\AnyThing.txt{Enter}", Wait:=True

however i want anyone to use this so i want to get rid of "Fred_Bloggs"

i tried

SendKeys Thisworkbook.Path & "\Folder2\AnyThing.txt{Enter}", Wait:=True

but its not happy any ideas?

Thanks
Arnie