Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Send a bunch of backspaces
-- Gary''s Student - gsnu200809 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
sorry not following you
"Gary''s Student" wrote: Send a bunch of backspaces -- Gary''s Student - gsnu200809 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It looks like I'm missing a space in the following instruction
from MyAppID = Shell("notepad.exe" & FName, 1) ' Run Microsoft Word. to MyAppID = Shell("notepad.exe " & FName, 1) ' Run Microsoft Word. You don't have to open a notepad application if the window is already opened. You can use the Window name instead of the process ID in the AppActivate AppActivate "AnyThing.txt" "Arnie" wrote: 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 |