L
Lenny_821
Because when I try to save the document it give's me the followin
message;
"you cannot save to this fileformat when the VBA project is protected"
here's the code;
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Dim MyVar
On Error GoTo EndHere
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect
'my code here
Application.ScreenUpdating = True
ActiveWorkbook.Protect
Exit Sub
EndHere:
MyVar = MsgBox(Text1, 16, Text2)
End Su
message;
"you cannot save to this fileformat when the VBA project is protected"
here's the code;
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Dim MyVar
On Error GoTo EndHere
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect
'my code here
Application.ScreenUpdating = True
ActiveWorkbook.Protect
Exit Sub
EndHere:
MyVar = MsgBox(Text1, 16, Text2)
End Su