checking if file is saved

J

John

I would like to enter code to check if the file was saved before closing
I am using a form with a close button.

'check here if file has been saved first
??

Worksheets("StartupSheet").Activate
Application.Quit
 
R

Rob Bovey

John said:
I would like to enter code to check if the file was saved before closing
I am using a form with a close button.

Hi John,

If Not ActiveWorkbook.Saved Then
''' The workbook is not saved. Take action here.
End If

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
Top