macro from excel to wordpad


Posted by Andy Gilchrist on November 07, 2000 7:39 AM

How do I run a macro (VB) to copy from excel and paste into wordpad? I know how to do it into word, but I can't figure out how to go to wordpad. Please advise.



Posted by Ivan Moala on November 08, 2000 1:54 AM

To copy from excel to wordpad use the shell comm

eg.
Sub RunWP_Paste()

'Copy
ActiveSheet.Range("A1:C12").Copy
'Run Wordpad
Shell "write.exe", vbMaximizedFocus

THour = Hour(Now())
TMinute = Minute(Now())
TSecond = Second(Now()) + 3
waitTime = TimeSerial(THour, TMinute, TSecond)
Application.Wait waitTime

'Paste
Application.SendKeys "(^V)"

End Sub


ivan