Live-Forum - Die aktuellen Beiträge
Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender

Forumthread: WS.Protect und Contents/Scenarios etc. ermitteln

WS.Protect und Contents/Scenarios etc. ermitteln
norman
Hallo alle,
ich habe ein Worksheet, das mit mir nicht bekannten Einstellungen für Contents/Szenarios/UserInterfaceOnly etc. geschützt wurde. Ich kenne das Passwort und entferne es mit unprotect. Danach will ich Protect wieder anwenden, weiss aber nicht, wie Contents/Szenarios/UserInterfaceOnly etc. vorher gesetzt war. Ist es möglich das zu ermitteln, während das Blatt noch geschützt ist, also herauszufinden, was in Contents/Szenarios/UserInterfaceOnly etc. steht bzw. zum Zeitpunkt des anbringen des Blattschutzes stand?
Viele Grüße
Norman
Anzeige

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Benutzer
Anzeige
AW: Einstellungen Blattschutz anzeigen
01.09.2010 02:11:49
fcs
Hallo Norman,
soweit ich bisher gesehen habe werden beim erneuten Setzen des Blattschutzes im Dialogfenster die vorherigen Einstellungen angezeigt.
Mit dem folgenden Makro kannst du die Einstellungen eines geschützten Blatts ermitteln.
Ich weiss nicht, ob unter Excel 2003 schon die gleichen Einstellungen möglich waren, wie unter 2007. Es könnte also sein, das du die eine oder andere Code-Zeile rausnehmen muss.
Gruß
Franz
Sub BlattSchutzeinstellungen()
' Erstellt unter Excel 2007
Dim wks As Worksheet, a(1 To 16, 0 To 1), sMsgText As String, iIndex As Long
Set wks = ActiveSheet
a(1, 0) = "AllowDeletingColumns: "
a(1, 1) = wks.Protection.AllowDeletingColumns
a(2, 0) = "AllowDeletingRows:"
a(2, 1) = wks.Protection.AllowDeletingRows
a(3, 0) = "AllowEditRanges (Anzahl): "
a(3, 1) = wks.Protection.AllowEditRanges.Count
a(4, 0) = "AllowFiltering: "
a(4, 1) = wks.Protection.AllowFiltering
a(5, 0) = "AllowFormattingCells: "
a(5, 1) = wks.Protection.AllowFormattingCells
a(6, 0) = "AllowFormattingColumns: "
a(6, 1) = wks.Protection.AllowFormattingColumns
a(7, 0) = "AllowFormattingRows: "
a(7, 1) = wks.Protection.AllowFormattingRows
a(8, 0) = "AllowInsertingColumns: "
a(8, 1) = wks.Protection.AllowInsertingColumns
a(9, 0) = "AllowInsertingHyperlinks: "
a(9, 1) = wks.Protection.AllowInsertingHyperlinks
a(10, 0) = "AllowInsertingRows: "
a(10, 1) = wks.Protection.AllowInsertingRows
a(11, 0) = "AllowSorting: "
a(11, 1) = wks.Protection.AllowSorting
a(12, 0) = "AllowUsingPivotTables: "
a(12, 1) = wks.Protection.AllowUsingPivotTables
a(13, 0) = "ProtectDrawingObjects: "
a(13, 1) = wks.ProtectDrawingObjects
a(14, 0) = "ProtectScenarios: "
a(14, 1) = wks.ProtectScenarios
a(15, 0) = "ProtectContents: "
a(15, 1) = wks.ProtectContents
a(16, 0) = "ProtectionMode(UserInterfaceOnly): "
a(16, 1) = wks.ProtectionMode
sMsgText = "Einstellungen Blattschutz" & vbNewLine
For iIndex = 1 To UBound(a)
sMsgText = sMsgText & vbNewLine & a(iIndex, 0) & a(iIndex, 1)
Next
MsgBox sMsgText, vbInformation + vbOKOnly, "Schutzeinstellungen für aktives Blatt"
End Sub

Anzeige
;

Forumthreads zu verwandten Themen

Anzeige
Anzeige
Entdecke relevante Threads

Schau dir verwandte Threads basierend auf dem aktuellen Thema an

Alle relevanten Threads mit Inhaltsvorschau entdecken
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige