Create a macro to launch notepad while in Excel.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to create a macro to launch notepad while in Excel. The macro
should then return to the opened spreadsheet in Excel.
 
Hi
Shell "NOTEPAD.EXE"
AppActivate "Microsoft Excel"
(tested on Win Xp Pro + Excel 2003)
HTH
Cordially
Pascal
 
Sub OpenNotepad()
Dim RetVal As Variant
RetVal = Shell("C:\Windows\Notepad.exe", 4)
MsgBox "Notepad is open."
End Sub
 
Just to add to this, if you have a specific file in mind, you can add it to
the command line e.g.

shell "notepad c:\myfile.txt"

Gareth
 
Back
Top