Excel VB Macro

Started by
1 comment, last by evolutional 18 years, 10 months ago
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?
Advertisement
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.
Using ShellExecute instead of VBA's Shell function

This topic is closed to new replies.

Advertisement