N
Nick B
Probably not understanding something simple, but can you lock a toolbar so
that it cannot be resized? I tried the code below but it had no effect. If I
changed .Protection to equal msoBarNoMove, it indeed kept me from moving the
bar, but I just don't want users to be able to resize it.
Thanks!
I tried:
Sub CustomToolbar()
Dim myBar As CommandBar
Dim myCtrl1 As CommandBarControl, myCtrl2 As CommandBarControl
Set myBar = CommandBars.Add(Name:="My Command Bar", Position:=msoBarTop,
Temporary:=True)
With myBar
Set myCtrl1 = .Controls.Add(Type:=msoControlButton,
ID:=CommandBars("Standard").Controls("Print").ID)
Set myCtrl2 = .Controls.Add(Type:=msoControlButton,
ID:=CommandBars("Standard").Controls("Save").ID)
.Visible = True
.Protection = msoBarNoChangeVisible + msoBarNoCustomize +
msoBarNoResize
End With
End Sub
that it cannot be resized? I tried the code below but it had no effect. If I
changed .Protection to equal msoBarNoMove, it indeed kept me from moving the
bar, but I just don't want users to be able to resize it.
Thanks!
I tried:
Sub CustomToolbar()
Dim myBar As CommandBar
Dim myCtrl1 As CommandBarControl, myCtrl2 As CommandBarControl
Set myBar = CommandBars.Add(Name:="My Command Bar", Position:=msoBarTop,
Temporary:=True)
With myBar
Set myCtrl1 = .Controls.Add(Type:=msoControlButton,
ID:=CommandBars("Standard").Controls("Print").ID)
Set myCtrl2 = .Controls.Add(Type:=msoControlButton,
ID:=CommandBars("Standard").Controls("Save").ID)
.Visible = True
.Protection = msoBarNoChangeVisible + msoBarNoCustomize +
msoBarNoResize
End With
End Sub