Excel VB Macro
I have an excel macro that detects the current spreadsheet being closed and runs:
Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean)
MsgBox "App_WorkbookBeforeClose: " & Wb.Name
End Sub
Now I suck with VB, but before I bang my head against a wall trying to figure this out, Is there a way of having App_WorkbookBeforeClose run another executable?
Is this possible?
Search in MSDN Library or in the internet for the Shell function.
The shell function must be available from VBA.
This function spawns a process by passing a path to an exe file.
This function spawns a process, but unlike CreateProcess, it don't take ownership of the process, so when excel is closed the spawned process remains alive.
The shell function must be available from VBA.
This function spawns a process by passing a path to an exe file.
This function spawns a process, but unlike CreateProcess, it don't take ownership of the process, so when excel is closed the spawned process remains alive.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement