Is there a way to warn a user that there are errors on a spreadsheet when trying to save it and then stop the save process? I would like to keep the spreadsheet from being saved until all required fields have valid data in them. I am working on Excel 2000.
Add the BeforeSave procedure to the workbook so you can check the required fields before allowing the save:
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim blnErrors As Boolean
'code to check input...
If blnErrors = True
MsgBox "An error was detected, please try again."
Cancel = True
End If
End Sub
Thanks for the info. I almost had it working by the time I got this response. This cleared up what I was NOT doing right and of course, helped me in adding a call subroutine to the BeforeClose trigger. Now I have my Excel sheet holding for correction even if the "X" is clicked. What would we do without "WIZARDS" like you?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.