Shell command to post to notepad

  • Thread starter Thread starter Mbt6
  • Start date Start date
M

Mbt6

I want to paste some information to note pad from excel

in vba I do something like

Range("c2").Select
Range(Selection, Selection.End(xlDown)).Copy
Shell("notepad.exe")


I need something in the Shell command to make the notepad window active, and
be able to paste to it. Any ideas?

--thanks --mike
 
Here is a particularly nasty example

Shell "Notepad.exe", 1
DoEvents
Application.SendKeys "ABC" & Chr(13), True
Application.SendKeys "XYZ", True
AppActivate Application.Caption

but would it not be better to just write to a text file directly?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
BTW, paste would be

Sub Tester3()
Range(Range("c2"), Range("c2").End(xlDown)).Copy
Shell "Notepad.exe", 1
DoEvents
Application.SendKeys "^v", True
AppActivate Application.Caption
End Sub




--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Is there a similar shell command from webpage (copy one or two items from a
table in the webpage )
to excel
I know how to get a table from webpage.using web query.
Or can this be only from excel to another microsoft office item.
thanks.
 
Back
Top