Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saved Property in Excel XP.

Status
Not open for further replies.

Porsche996GT2

Programmer
Oct 13, 2004
41
0
0
US
Hello,

I tried the Saved property of a workbook in Excel XP to exit without getting the prompt to save it. But for some reason, it does not work, although it worked perfectly when I used Excel 97. Is there a reference that I have to add to make it work? TIA!
 
nope

thisworkbook.saved = true
or
activeworkbook.saved = true

should work perfectly well.....as long as no changes are made AFTER that line has been executed or it will be set back to false

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Hi Geoff,

I'm not sure why it's not working, but my close button sets the saved property of the workbook to true before closing it, there's no other code in between them:

With ThisWorkbook
.Saved = True
.Close
End With

This is what I have in my module. It works fine as long as I don't make any changes. But when I do, it prompts me to save the file. Any other ideas? Thanks for your reply.
 
And this ?
With ThisWorkbook
.Saved = True
.Close False
End With

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Great! Now that works... is there a reason why I have to add false now to the close method?

 
Just a thought...

Are you sure you don't have an Auto_Close or Workbook_BeforeClose procedure that is making some change to the workbook. If so, that would account for the "Do you want to Save" prompt, since the change would occur after .Saved=True was invoked by your Close button.


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top