Consulting

Results 1 to 3 of 3

Thread: Sleeper: Close Workbook and via Close Excel

  1. #1

    Sleeper: Close Workbook and via Close Excel

    Hi Guys and Gals,

    In the Close Event is there a way to tell if this is from the File / Close on the workbook, or from closing the Excel application?

    The reason is, I have some code in an Add-In that is executed on the Close event, but I have found a known problem that during the Exel Application Close it unloads Add-Ins before all open spreadsheets are closed; thus depending on what other spreadsheets are being closed and timing, I get spurious fails.

    I've already got code that checks that the Add-In exists before a module within it is called, but maybe the add-in unload is happening after that check returns the Add-In does exist.

    Any ideas please?
    thanks,
    Michael

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    I haven't ever seen a method of determining if the App is quiting or just one file. You can get some application level events with a class module, but there isn't a Quit event.

    Can you add some code to the Addin Uninstall event? Maybe post an attachment or some code that illustrates the specific problem you are getting.

  3. #3
    Hi Jake,

    I'm not sure what I could add to the Uninstall Event to stop the random fails.

    The Bug I think is casuing this is described at http://support.microsoft.com/default...b;en-us;831200 . The final sentence in the Cause section apears to be what I am suffering: Because of this problem, COM Add-Ins can be prematurely unloaded before the actual application termination.

    If this is correct, then I am trying to call a module in the Addin whilst that Addin is being uninstalled (but was there a nono-second ago).

    Any other ideas?

    thanks

    Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •