Problem With Auto_Close and QUIT() Function - XLM4 Macros

A

Art

I have a worksheet that invokes an XLM4 macro function when the
Auto_Close event occurs. This event is invoked whenever the worksheet is
closed or when the Excel application is terminated.

On my macro sheet, the called subroutine for Auto_Close does some
cleanup work (e.g.: restoring toolbar settings to previous states) and
then calls the QUIT() function to terminate Excel. Excel takes care of
prompting the user for worksheet saves.

This works as expected for worksheet-invoked close on Excel on the Mac
and Windows platforms.

It works as expected for Excel-invoked close on the Mac. However, on the
Windows platform suing the same code, the execution of the QUIT()
function in this instance causes a macro error.

I've experimented with all variants of the ERROR(FALSE) function.
Unfortunately, to make it work for Excel application close on Windows,
it causes the worksheet window close operation to bypass the prompt for
save.

Has anyone else seen this or know a way around it ?

TIA.

Art
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top