ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   can I cancel a save (https://www.excelbanter.com/excel-discussion-misc-queries/71920-can-i-cancel-save.html)

juls!1601

can I cancel a save
 


Dave Peterson

can I cancel a save
 
Nope.

Do you have backups?

juls!1601 wrote:

--

Dave Peterson

George

can I cancel a save
 
Yes and No

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Cancel = True
End Sub

Setting cancel to true will prevent the workbook from saving
use it with caution
Or try something like this

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If MsgBox("Do you really want to save?", vbYesNo) = vbNo Then
Cancel = True
End Sub


George


All times are GMT +1. The time now is 09:55 PM.

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