Sign in to follow this  
Mulligan

Excel VB Macro

Recommended Posts

Mulligan    378
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?

Share this post


Link to post
Share on other sites
Lestat3D    122
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this