ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook_BeforeSave not working. (https://www.excelbanter.com/excel-programming/420542-workbook_beforesave-not-working.html)

michelle

Workbook_BeforeSave not working.
 
This Workbook_BeforeSave code doesn't seem to work! There's a description
field that gets built in the StripOutSpecialCharacters subroutine once the
spreadsheet is saved and its not doing it.
When you do File-SaveAs manually and put it in a work folder when you open
the file the description is not built but if you save from the workfile the
Before_Save kicks in and builds the description in your saved copy.

The the heck is going on?



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

If Not CheckRules Then
MsgBox "Please fix the problems in this worksheet!", vbCritical,
"Errors Were Found"
Cancel = True
Exit Sub
Else
StripOutSpecialCharacters
'GetShortValue
End If

galimi

Workbook_BeforeSave not working.
 
Assuming checkRules returns False, we would need to see the code for the
StripOutSpecialCharacters routine.
--
http://www.ExcelHelp.us

888-MY-ETHER ext. 01781474



"Michelle" wrote:

This Workbook_BeforeSave code doesn't seem to work! There's a description
field that gets built in the StripOutSpecialCharacters subroutine once the
spreadsheet is saved and its not doing it.
When you do File-SaveAs manually and put it in a work folder when you open
the file the description is not built but if you save from the workfile the
Before_Save kicks in and builds the description in your saved copy.

The the heck is going on?



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

If Not CheckRules Then
MsgBox "Please fix the problems in this worksheet!", vbCritical,
"Errors Were Found"
Cancel = True
Exit Sub
Else
StripOutSpecialCharacters
'GetShortValue
End If


Rick Rothstein

Workbook_BeforeSave not working.
 
Where is CheckRules declared at?

--
Rick (MVP - Excel)


"Michelle" wrote in message
...
This Workbook_BeforeSave code doesn't seem to work! There's a description
field that gets built in the StripOutSpecialCharacters subroutine once the
spreadsheet is saved and its not doing it.
When you do File-SaveAs manually and put it in a work folder when you open
the file the description is not built but if you save from the workfile
the
Before_Save kicks in and builds the description in your saved copy.

The the heck is going on?



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

If Not CheckRules Then
MsgBox "Please fix the problems in this worksheet!", vbCritical,
"Errors Were Found"
Cancel = True
Exit Sub
Else
StripOutSpecialCharacters
'GetShortValue
End If




All times are GMT +1. The time now is 10:00 PM.

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