Thread
:
VBA how can I stop a Save
View Single Post
#
2
Posted to microsoft.public.excel.programming
Chip Pearson
external usenet poster
Posts: 7,247
VBA how can I stop a Save
Set the Cancel argument to True. E.g.,
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean,
Cancel As Boolean)
If Range("C10") = "" Then
MsgBox "Please complete cell C10"
Cancel = True
Exit Sub
End If
End Sub
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"newboy18" wrote in message
...
I would like to stop users from saving a workbook if a
cells contents have not been completed, I know that I can
use the Event BeforeSave to do a test on the contents of a
cell but how can I stop the save
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean,
Cancel As Boolean)
If Range("C10") = "" Then
MsgBox "Please complete cell C10"
Exit Sub
End If
End Sub
Reply With Quote
Chip Pearson
View Public Profile
Find all posts by Chip Pearson