L
Learner
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").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
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").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