Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How could I trap toolbar events: I'd like a boolean variable to change
when a custom toolbar has been made invisible i.e it is a floating custom toolbar and I'd like a boolean variable to change when the user hits the cross to make the bar invisible. Is a class module the only answer? Regards Jason. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
bVisible = commandbars("My Command Bar").visible
HTH -- AP "WhytheQ" a écrit dans le message de news: ... How could I trap toolbar events: I'd like a boolean variable to change when a custom toolbar has been made invisible i.e it is a floating custom toolbar and I'd like a boolean variable to change when the user hits the cross to make the bar invisible. Is a class module the only answer? Regards Jason. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is no event that fires when the visible property of a command bar is
changed so I am affraid you are out of luck on this one. -- HTH... Jim Thomlinson "WhytheQ" wrote: How could I trap toolbar events: I'd like a boolean variable to change when a custom toolbar has been made invisible i.e it is a floating custom toolbar and I'd like a boolean variable to change when the user hits the cross to make the bar invisible. Is a class module the only answer? Regards Jason. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You dont need events or hooks. Simply use protection for your bar (see VBA help for details): Sub ObstinateBar() On Error Resume Next CommandBars("Test").Delete On Error GoTo 0 With CommandBars.Add("Test", msoBarFloating, , True) With .Controls.Add(msoControlButton, , , , True) .Caption = "Button" .FaceId = 59 .OnAction = " BtnHandler" End With .Visible = True .Protection = msoBarNoChangeDock + _ msoBarNoChangeVisible + _ msoBarNoCustomize End With 'OfficeXP has a few more options 'Following code will compile and work in versions 97-2003 #If VBA6 Then If Val(Application.Version) 10 Then CallByName CommandBars, "DisableAskAQuestionDropdown", VbLet, True CallByName CommandBars, "DisableCustomize", VbLet, True End If #End If End Sub -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam WhytheQ wrote in groups.com How could I trap toolbar events: I'd like a boolean variable to change when a custom toolbar has been made invisible i.e it is a floating custom toolbar and I'd like a boolean variable to change when the user hits the cross to make the bar invisible. Is a class module the only answer? Regards Jason. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
as per usual where others give up, KeepItCool comes up with the goods:
Thanks! J keepITcool wrote: You dont need events or hooks. Simply use protection for your bar (see VBA help for details): Sub ObstinateBar() On Error Resume Next CommandBars("Test").Delete On Error GoTo 0 With CommandBars.Add("Test", msoBarFloating, , True) With .Controls.Add(msoControlButton, , , , True) .Caption = "Button" .FaceId = 59 .OnAction = " BtnHandler" End With .Visible = True .Protection = msoBarNoChangeDock + _ msoBarNoChangeVisible + _ msoBarNoCustomize End With 'OfficeXP has a few more options 'Following code will compile and work in versions 97-2003 #If VBA6 Then If Val(Application.Version) 10 Then CallByName CommandBars, "DisableAskAQuestionDropdown", VbLet, True CallByName CommandBars, "DisableCustomize", VbLet, True End If #End If End Sub -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam WhytheQ wrote in groups.com How could I trap toolbar events: I'd like a boolean variable to change when a custom toolbar has been made invisible i.e it is a floating custom toolbar and I'd like a boolean variable to change when the user hits the cross to make the bar invisible. Is a class module the only answer? Regards Jason. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I "re-hook" my worksheet window to my Excel window? | Excel Discussion (Misc queries) | |||
How can I "re-hook" my worksheet window to my Excel window? | Excel Discussion (Misc queries) | |||
do events? background events | Excel Programming | |||
Adjusting toolbar size, restore toolbar | Excel Discussion (Misc queries) | |||
hook into worksheet events temporarily? | Excel Programming |