Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default 'Saved' Property not working

Thanks.

I think I've narrowed the problem. When I run the code below, the 1st msgbox
returns TRUE and the 2nd msgbox returns FALSE. Something strange happens in
between which sets the Saved property to FALSE.

This problem only occurs using the Save As method. Using the Save method the
Saved property always remains TRUE. Those articles which you suggested didn't
really help either.

Any more suggestions?


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



"Jim Rech" wrote:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 'Saved' Property not working

That's really perplexing. Sorry, I have no idea what's causing this.
--
Jim Rech
Excel MVP

"exceller" wrote in message
...
Thanks.

I think I've narrowed the problem. When I run the code below, the 1st
msgbox
returns TRUE and the 2nd msgbox returns FALSE. Something strange happens
in
between which sets the Saved property to FALSE.

This problem only occurs using the Save As method. Using the Save method
the
Saved property always remains TRUE. Those articles which you suggested
didn't
really help either.

Any more suggestions?


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



"Jim Rech" wrote:

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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formual not working when 2003 WKB saved as 2007 Macro Enabled WKB Corey .... Excel Worksheet Functions 3 March 26th 09 05:44 AM
Visual Basic code not working when sheet is saved joe123 Excel Discussion (Misc queries) 3 October 22nd 08 01:50 PM
working on excel document in email saved changes in email not in . butter Excel Discussion (Misc queries) 2 February 20th 06 09:25 AM
Listbox text property not working correctly Shawn[_2_] Excel Programming 2 October 2nd 03 02:35 PM


All times are GMT +1. The time now is 07:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"