Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Check to see if excel file has been saved

How do you check if an excel file has been saved in VBA? That is, if I have
an excel file open, what property tells me if the file has been saved yet?

I am thinking of an instance where I open a new workbook and forget to save
it. I want to run a macro that tells me that although the file is open, it
has not been saved yet.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Check to see if excel file has been saved

activeworkbook.saved (true or False)

G

ExcelMonkey wrote:
How do you check if an excel file has been saved in VBA? That is, if I have
an excel file open, what property tells me if the file has been saved yet?

I am thinking of an instance where I open a new workbook and forget to save
it. I want to run a macro that tells me that although the file is open, it
has not been saved yet.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Check to see if excel file has been saved

From VBA Help for "Saved":

Saved Property Example

This example displays a message if the active workbook contains unsaved
changes.

If Not ActiveWorkbook.Saved Then
MsgBox "This workbook contains unsaved changes."
End IfThis example closes the workbook that contains the example code and
discards any changes to the workbook by setting the Saved property to True.

ThisWorkbook.Saved = True
ThisWorkbook.CloseMike F"ExcelMonkey"
wrote in message
...
How do you check if an excel file has been saved in VBA? That is, if I
have
an excel file open, what property tells me if the file has been saved yet?

I am thinking of an instance where I open a new workbook and forget to
save
it. I want to run a macro that tells me that although the file is open,
it
has not been saved yet.

Thanks



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
Excel File saved as Temp file DennisM New Users to Excel 1 January 7th 10 04:56 PM
Number Format on Excel File saved from .html file joyfulone Excel Discussion (Misc queries) 3 April 15th 09 12:07 AM
Saved *.csv file gives SYLK file type warning upon Excel 2003 open Tom Excel Discussion (Misc queries) 5 March 19th 08 03:15 PM
Can I reverse a saved file to the previous file in Excel? highlandmom Excel Discussion (Misc queries) 5 August 28th 07 04:10 PM
CSV file saved as Excel alma Excel Discussion (Misc queries) 3 March 21st 06 08:31 PM


All times are GMT +1. The time now is 10:24 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"