Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why doesn't the workbook get saved here ?
Private Sub Workbook_BeforeSave(ByVal SaveAsUi As Boolean, Cancel As Boolean) Application.EnableEvents = False ThisWorkbook.Worksheets("Sales").Protect Password:="123", UserInterfaceOnly:=True, Scenarios:=True, Contents:=True ThisWorkbook.Save ThisWorkbook.Worksheets("Sales").Unprotect Password:="123" Cancel = True Application.EnableEvents = True End Sub This sub get's called with ThisWorkbook.Save and debug does step through it all the way, only it doesn't get saved?! Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Disable Save/Save As - not working? | Excel Discussion (Misc queries) | |||
HELP!!!! Calling a sub from Workbook_BeforeSave | Excel Discussion (Misc queries) | |||
Worksheet Buttons (Save, Save As, Cut, Paste, etc.) Not Working | Excel Worksheet Functions | |||
Workbook_BeforeSave | Excel Programming | |||
Workbook_BeforeSave() in xla | Excel Programming |