Hallo Hans,
Weist du eine Lösung?
Ich habe schon soviel gesehen, was du so machst und war begeistert!
Gruss Werner
Hallo Hans,
Weist du eine Lösung?
Ich habe schon soviel gesehen, was du so machst und war begeistert!
Gruss Werner
wenn du das "Disable" Codeteil in das "Workbook_Open"-Ereignis und das "Enable"-Codeteil in das "Workbook_Close"-Ereignis deiner Arbeitsmappe kopierst, werden die Buttons "Blatt schützen" und "Arbeitsmappe schützen" deaktiviert, bzw. aktiviert.
Sub Enable_Protect_Button()
Code eingefügt mit Syntaxhighlighter 1.16
Sub Disable_Protect_Button()
For n = 1 To Application.Commandbars.Count
For i = 1 To Application.Commandbars(n).Controls.Count
If Application.Commandbars(n).Controls(i).ID = 893 Or Application.Commandbars(n).Controls(i).ID = 894 Then
Application.Commandbars(n).Controls(i).Enabled = False
End If
Next i
Next n
End Sub
For n = 1 To Application.Commandbars.Count
For i = 1 To Application.Commandbars(n).Controls.Count
If Application.Commandbars(n).Controls(i).ID = 893 Or Application.Commandbars(n).Controls(i).ID = 894 Then
Application.Commandbars(n).Controls(i).Enabled = True
End If
Next i
Next n
End Sub
Allerdings können damit natürlich keine benutzerdefinierten Buttons gefunden die mit dem Befehl hinterlegt sind.
Gruss Rainer