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

Thanks i did find this

Shell "notepad.exe", vbNormalFocus
Application.SendKeys ("^V")

which works for opening and pasting
but i can't find anything for SaveAs

i am selecting data from different sheets in excel then using notepad to
paste this data into. the notepad is then saved as a script file. Hence the
need to control notepad

"Joel" wrote:

You can open notepad with the following statements and then change the focus
to the NotePad window with these commands

Root = Environ("SystemRoot")

ID = Shell(Root & "\Notepad.exe")
AppActivate ID

Use copy commnd from excel to put data into Cliupbord before opening Notepad
and changing the focus. Then use "SendKey" commnd to send the key stokes
required to Notepad. You can use the ShortCuts in NotePad like Cntl+V to
paste.

"Arnie" wrote:

is it possible to control Notepad from a macro ie open a new notepad, paste
data in and then save as.

If so how do i call notepad in VB

thanks in advance