ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   checking if file is saved (https://www.excelbanter.com/excel-programming/308312-checking-if-file-saved.html)

John

checking if file is saved
 
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

Rob Bovey

checking if file is saved
 
"John" wrote in message
...
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 *


"John" wrote in message
...
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





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com