PDA

View Full Version : Solved: Workbook Save Flag



CreganTur
08-22-2008, 08:52 AM
For Word, I can use:
ActiveDocument.Saved = True
to flag a document as saved (or not dirty). I use this as the last line of a Document_Close event, so that the "Do you want to save changes" dialog does not appear- it just closes without incident.

Is there something similar in Excel?

kobiis
08-22-2008, 09:06 AM
Try this one...


Me.Saved = True

CreganTur
08-22-2008, 09:11 AM
Try this one...




VBA:
Me.Saved = True



'Me' refers only to a UserForm, and can only be used by the code behind said form. It's a shortcut method for refering to an object (or status) of a UserForm.

Bob Phillips
08-22-2008, 09:12 AM
No, Me refers to the containing object, be that a Userform, a workbook (ThisWorkbook), a worksheet, or a custom object, when used within that object's class module.

You probably want



Activeworkbook.Saved = True

CreganTur
08-22-2008, 09:15 AM
You probably want

That is exactly what I want :hifive: