Results 1 to 6 of 6
  1. #1
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .SAVED not work (xl97/xl2000)

    <P ID="del"><FONT SIZE=-1>Post deleted by jujuraf</FONT>

  2. #2
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: .SAVED not work (xl97/xl2000)

    If I display ThisWorkbook.Saved in a simple workbook, it works OK.

    What I've found in the past is, that if a workbook has functions like "=Today" or "=now()" it seems to change that value, and this make it "dirty".

    You might need to do something like:
    <pre>ThisWorkbook.Close savechanges:=False</pre>

    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

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

    Re: .SAVED not work (xl97/xl2000)

    The Workbook.Saved property seems to work just fine in my Excel 97. It sounds like you may have some VBA code running is an event routing somewhere that is causing the .Saved property to be set back to False.
    Legare Coleman

  4. #4
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: .SAVED not work (xl97/xl2000)

    I just discovered that Thisworkbook.Saved returns False even if the only thing I did was click a tab to go to a different worksheet. No code was changed, nothing on any worksheet, just the act of moving to a new worksheet causes this flag to be changed. I guess MS has a different definition of Saved than I do. It's the same in xl97 too (my code activates a certain sheet when the workbook is opened. This then sets the Thisworkbook.Saved flag to False which means if I immediately Quit, I get the yes/no/cancel dialog to save the workbook.)

    Lesson Learned. I can't rely on Thisworkbook.Saved to tell me that the workbook has changed (and I don't count activating a worksheet as a change).

    Thnx All, Deb <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15>

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

    Re: .SAVED not work (xl97/xl2000)

    It's not something that MS did, because that is not what happens in my Excel. Again, my guess is that something in some of your event code is causing Excel to think that something in the workbook changed. If it is happening when you select a new worksheet, then the first place I would look would be in the Workbook Selection Change event procedure.
    Legare Coleman

  6. #6
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: .SAVED not work (xl97/xl2000)

    Hmm, Ok I figured it out and you're right. I added debug statements in all my workbook events and I WAS updating the workbook. At workbook open, I update one of the fields in ThisWorkbook.BuiltinDocumentProperties and that's what caused it to set the flag to False. DUH!!! From the user's point of view, they don't know this of course and they see Excel as asking them to save a workbook that hasn't changed (ah, but it has changed!)

    Sorry for the confusion.
    Deb <img src=/S/blush.gif border=0 alt=blush width=15 height=15> <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

Posting Permissions

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