Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
protection using UserInterfaceOnly
Hello,
I have this code that does not seem to be working in Excel 2003 (it was in 2000): ActiveSheet.protect UserInterfaceOnly:=True (line 4). Is there a new equivalence? It was used within a procedure to access the code via a toolbar. Sub hideQ1() Dim cbrCommandBar As CommandBar Dim cbcCommandBarButton As CommandBarButton ActiveSheet.protect UserInterfaceOnly:=True Columns("B:D").Select Selection.EntireColumn.Hidden = True Set cbrCommandBar = _ Application.CommandBars("QBR Operating Tool Bar") If Application.CommandBars("QBR Operating Tool Bar").Controls.Item(2).Caption _ = " Hide Q1 " Then With cbrCommandBar.Controls Set cbcCommandBarButton = cbrCommandBar.Controls.Item(2) With cbcCommandBarButton .Style = msoButtonCaption .Caption = " Show Q1 " .TooltipText = "Show Quarter 1 / Affiche le 1er trimestre" .OnAction = "showQ1" End With End With End If Range("A13").Activate End Sub Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
protection using UserInterfaceOnly
I think it was xl2002 that became more stringent with worksheet protection.
Try adding the password in the .protect line: ActiveSheet.protect Password:="hi there", UserInterfaceOnly:=True Learner wrote: Hello, I have this code that does not seem to be working in Excel 2003 (it was in 2000): ActiveSheet.protect UserInterfaceOnly:=True (line 4). Is there a new equivalence? It was used within a procedure to access the code via a toolbar. Sub hideQ1() Dim cbrCommandBar As CommandBar Dim cbcCommandBarButton As CommandBarButton ActiveSheet.protect UserInterfaceOnly:=True Columns("B:D").Select Selection.EntireColumn.Hidden = True Set cbrCommandBar = _ Application.CommandBars("QBR Operating Tool Bar") If Application.CommandBars("QBR Operating Tool Bar").Controls.Item(2).Caption _ = " Hide Q1 " Then With cbrCommandBar.Controls Set cbcCommandBarButton = cbrCommandBar.Controls.Item(2) With cbcCommandBarButton .Style = msoButtonCaption .Caption = " Show Q1 " .TooltipText = "Show Quarter 1 / Affiche le 1er trimestre" .OnAction = "showQ1" End With End With End If Range("A13").Activate End Sub Thank you -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
protection using UserInterfaceOnly
Reposting for an answer.
Thank you ____________ "Learner" wrote in message ... Hello, I have this code that does not seem to be working in Excel 2003 (it was in 2000): ActiveSheet.protect UserInterfaceOnly:=True (line 4). Is there a new equivalence? It was used within a procedure to access the code via a toolbar. Sub hideQ1() Dim cbrCommandBar As CommandBar Dim cbcCommandBarButton As CommandBarButton ActiveSheet.protect UserInterfaceOnly:=True Columns("B:D").Select Selection.EntireColumn.Hidden = True Set cbrCommandBar = _ Application.CommandBars("QBR Operating Tool Bar") If Application.CommandBars("QBR Operating Tool Bar").Controls.Item(2).Caption _ = " Hide Q1 " Then With cbrCommandBar.Controls Set cbcCommandBarButton = cbrCommandBar.Controls.Item(2) With cbcCommandBarButton .Style = msoButtonCaption .Caption = " Show Q1 " .TooltipText = "Show Quarter 1 / Affiche le 1er trimestre" .OnAction = "showQ1" End With End With End If Range("A13").Activate End Sub Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UserInterfaceOnly & Password Protection | Excel Discussion (Misc queries) | |||
Excel 2003 Userinterfaceonly Password Protection Problem | Excel Programming | |||
UserInterfaceOnly on the Mac | Excel Programming | |||
question about worksheet protection using userinterfaceonly:=true | Excel Programming | |||
Protection UserInterfaceOnly reading Hidden Formulas | Excel Programming |