catching visio close event

Started by vba_forever, November 09, 2012, 09:39:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vba_forever

Once the close Visio button has been clicked, is there a way to catch the event and still access page objects/data?

There seems to be a significant difference between the BeforeClose() routine of Excel and Visio.  In Excel, there is a cancel variable that can be set to true or false, so that the code can halt the exit of the document.  Also, all of the Excel information is still available (sheet, cells, vba globals, etc).  In Visio, it seems that once the Document_BeforeDocuementClose code is executed, the Visio document (but not the vba component) has already been closed.  This is supported by the absence of the cancel variable.  Any attempt to reference a sheet or shape is met with "undefined value".

Does the Excel version of BeforeClose() exist in visio?

I am running Excel and Visio 2010.

thanks in advance!

AndyW

You need to use the QueryCancelDocumentClose event, that way you can prevent it being closed etc
Live life with an open mind