We help IT Professionals succeed at work.

Run macro when visio closes

WINAIRMVS
WINAIRMVS asked
on
Medium Priority
833 Views
Last Modified: 2012-08-14
I need to run a macro when closing visio, and I can't seem to find the appropriate documentation to get me there.  Any help would be appreciated.
Comment
Watch Question

I hope this will bring you a bit further:

http://msdn.microsoft.com/en-us/library/ms427232.aspx
If you are working with a specific file, you can add a "Before Document Close" event.
Enter the VBA editor, find the "This document" section in the project explorer, and select the BeforeDocumentClose event in the dropdown to the far right.

Author

Commented:
I added the code to "This Document" which did not act on the closing of the document.
Private Sub BeforeDocumentClose()
 nameofmacroIwanttorun
end

Open in new window

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Answer was what I needed.  There was some extra code that wasn't necessary for what I was looking for, but otherwise great answer!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.