W
Werner Rohrmoser
Hello,
below 2 code snippets:
1. Located in ThisWorkbook DocumentModule
************************************************************************************************************
Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Worksheets("Tabelle3")
.Select
.Unprotect
End With
MsgBox "Hello"
End Sub
************************************************************************************************************
2. Located in a regular Module:
************************************************************************************************************
Option Explicit
Public Sub SaveProc()
ThisWorkbook.Save
End Sub
************************************************************************************************************
When I use the save button on the Excel menu it works, Tabelle3 is
selected and unprotected,
the message box appears.
When I use the macro located in the regular module Tabelle3 will be
NOT selcted and NOT unprotected,
but the message box shows up.
Any help would be appreciated.
Thanks.
WIN XP 5.1.2600 SP1 Build 2600
Excel 2002 SP3
below 2 code snippets:
1. Located in ThisWorkbook DocumentModule
************************************************************************************************************
Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Worksheets("Tabelle3")
.Select
.Unprotect
End With
MsgBox "Hello"
End Sub
************************************************************************************************************
2. Located in a regular Module:
************************************************************************************************************
Option Explicit
Public Sub SaveProc()
ThisWorkbook.Save
End Sub
************************************************************************************************************
When I use the save button on the Excel menu it works, Tabelle3 is
selected and unprotected,
the message box appears.
When I use the macro located in the regular module Tabelle3 will be
NOT selcted and NOT unprotected,
but the message box shows up.
Any help would be appreciated.
Thanks.
WIN XP 5.1.2600 SP1 Build 2600
Excel 2002 SP3