#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default cancel save

Hi lawson.
If you look at the help on line you will find:

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

Regards
Eliano
"lawson" wrote:

i want a pre-save program to check if there is a value in cell a1 before
someone saves. if there is, and user clicks 'No' then it will cancel saving.

thank you

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Range("a1") = 1 Then aaa = MsgBox("Are you Sure?", vbCritical + vbYesNo,
"Dont want to Ruin Template!")

If aaa = vbNo Then ...

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
Cancel Save as a Web Page auto republish TJMasters Excel Discussion (Misc queries) 0 March 15th 07 09:24 PM
Save - Yes / No / Cancel Jon Peltier Excel Discussion (Misc queries) 9 May 7th 06 02:03 AM
can I cancel a save juls!1601 Excel Discussion (Misc queries) 2 February 16th 06 01:03 AM
Cancel user's changes but save other changes [email protected] Excel Discussion (Misc queries) 1 December 19th 05 12:09 PM
How to CANCEL file SAVE PROMPT when MACRO is running? Stuart Macro Muppet Excel Discussion (Misc queries) 3 August 11th 05 12:26 PM


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

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

About Us

"It's about Microsoft Excel"