MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Help Please! Execute Excel Macro on Workbook Close


Posted by JPK on August 01, 2001 1:34 PM

How do I force an Excel macro to execute when the workbook is closed?

Thanks in advance for your help.

JPK


Posted by Jim on August 01, 2001 1:46 PM

Put this in your "Thisworkbook" Module
Private Sub Workbook_BeforeClos(Cancel As Boolean)
'Your code.....
End Sub
Jim

Posted by JPK on August 01, 2001 1:53 PM

You are awesome. Thanks so much. (nfm)

Posted by Jim on August 01, 2001 2:06 PM

Re: You are awesome. Thanks so much. (nfm)

Typo: It should read:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Far from awesome i like yourself am only learning
but if you want to see awesome read the answers from
just to name a few: Damon Ostrander,Ivan Moala,
Aladin,Mark W.,Dax and so many more. The knowledge
of these people is beyond belief.
Jim

Posted by Jim on August 01, 2001 2:14 PM

Please read If you want to see awesome