Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Jul 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cannot change the Excel 2000 Saved Property (Excel 2000 SP3)

    We have run across a strange issue with our COM Add-in. We are handling the BeforeClose event and in the handler we are prompting the user to save the document and act accordingly. To prevent further prompts to save the document we set the Saved property to true. This seems to work fine in Excel 2002 & 2003, but it does not work in Excel 2000. When stepping through the code when running Excel 2000 we notice that immediately after explicitly setting the Saved property to True that it still equals False. Anyone have any ideas why the Saved property in Excel 2000 is not being reset to True? We have only tested this with with Office 2000 SP3. Do you have any suggestions that might help us work around this issue?

  2. #2
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot change the Excel 2000 Saved Property (E

    Welcome to the Lounge

    This is a known bug, see MSKB 238488 though that does say it was resolved with SR1

  3. #3
    New Lounger
    Join Date
    Jul 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cannot change the Excel 2000 Saved Property (E

    I should have mentioned that we found this article, but as you mentioned this was supposed to be corrected in SR1 and the article doesn't really apply to our situation anyway.

  4. #4
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot change the Excel 2000 Saved Property (E

    I have been unable to find a cause for your problem but can think of a couple of alternative approaches:

    1/ Turn off DisplayAlerts
    <pre>Application.DisplayAlerts = False
    ActiveWorkbook.Close
    Application.DisplayAlerts = True</pre>

    2/ Tell Excel not to save changes
    <pre>ActiveWorkbook.Close savechanges:=False</pre>


  5. #5
    New Lounger
    Join Date
    Jul 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cannot change the Excel 2000 Saved Property (E

    Thanks for the reply, Tony. We kicked both of these around a little bit but decided against them because we were already handling a close event and calling the Close method would trigger the BeforeClose event handler again. I don't think the DisplayAlerts property affects whether or not we display our prompt to save the file (will need to verify this), but I guess we could add a condition that checks the DisplayAlerts property, otherwise we would get stuck in an endless loop. Currently, in the BeforeClose event handler, we are only checking the Saved property to determine whether or not to prompt the user to save the document. If the user selects Yes we save the workbook, if the user selects No we do nothing, but in either case we are setting the Saved flag to True so the user does not get further prompts to save the workbook.

    This one is just kicking our butts right now.

  6. #6
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cannot change the Excel 2000 Saved Property (E

    If you:

    <pre> Application.EnableEvents = False
    </pre>


    before using the Close method, it should not trigger the before close event again. Don't forget to:

    <pre> Application.EnableEvents = True
    </pre>


    Before you exit the routine.
    Legare Coleman

Posting Permissions

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