View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default 'Saved' Property not working

There's no reason to set the Saved property after a save since Excel sets
it. Try this:

Sub Savefile()
SavedName = Application.GetSaveAsFilename
ThisWorkbook.SaveAs Filename:=SavedName
MsgBox ActiveWorkbook.Saved
End Sub

If this returns False for your problem workbook you might see if these
articles are useful:

http://support.microsoft.com/default...88&Product=xlw

http://support.microsoft.com/default...57&Product=xlw

--
Jim Rech
Excel MVP
"exceller" wrote in message
...
| Hi MVPs,
|
| When I set the Saved property of a workbook to True after saving the file
| using the GetSaveasFilename method, the Saved property still seems to be
| False. This is done by using the 2 subs below.
|
| For some reason, this is only the case for this particular program that I
am
| developing. For other Excel files and programs I have developed, the Saved
| property stays True.
|
| Any ideas why the Saved property would remain false even after setting it
to
| True?
|
|
| Sub Savefile()
| SavedName = Application.GetSaveAsFilename
| ThisWorkbook.SaveAs Filename:=SavedName
| ActiveWorkbook.Saved = True
| End Sub
|
| Sub Checksave()
| If Not ActiveWorkbook.Saved Then
| MsgBox "UNSAVED"
| Else: MsgBox "SAVED"
| End If
| End Sub