Skip to main content
GameDev.net gamedev.net
🔒 Locked

Excel VB Macro

Started by Mulligan Jun 3, 2005 at 11:16 AM 1 replies 1.1k views
Original Post
Mulligan
Mulligan
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?
Lestat3D
Lestat3D
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.