Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I ran the following code under Sheet1, ThisWorkbook and Module1 with no
problem: Public Sub ShowBarNames() Dim bar as CommandBar For Each bar in Application.CommandBars Debug.Print bar.Name Next End Sub Now, I get an error when the code is inside ThisWorkbook and CommandBars is not fully qualified, i.e.: Public Sub ShowBarNames() Dim bar as CommandBar For Each bar in CommandBars Debug.Print bar.Name Next End Sub How come? Isn't Commandbars a global object under Application? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
the unqualfied object in Thisworkbook becomes
Thisworkbook.CommandBars which raises the error. -- Regards, Tom Ogilvy "Victor" wrote in message ups.com... I ran the following code under Sheet1, ThisWorkbook and Module1 with no problem: Public Sub ShowBarNames() Dim bar as CommandBar For Each bar in Application.CommandBars Debug.Print bar.Name Next End Sub Now, I get an error when the code is inside ThisWorkbook and CommandBars is not fully qualified, i.e.: Public Sub ShowBarNames() Dim bar as CommandBar For Each bar in CommandBars Debug.Print bar.Name Next End Sub How come? Isn't Commandbars a global object under Application? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I get it. Is this true for any unqualified name in ThisWorkbook?
Thanks, Victor |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
List of Qualifying Values | Excel Discussion (Misc queries) | |||
Excel CommandBars | Excel Discussion (Misc queries) | |||
Qualifying OptionButton with ro without MSForms | Excel Programming | |||
Excel 2003 Commandbars | Excel Programming | |||
Qualifying sub names | Excel Programming |