Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Qualifying Commandbars - Excel 2000

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Qualifying Commandbars - Excel 2000

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Qualifying Commandbars - Excel 2000

I get it. Is this true for any unqualified name in ThisWorkbook?

Thanks,
Victor

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
List of Qualifying Values abergman Excel Discussion (Misc queries) 1 January 6th 09 01:15 AM
Excel CommandBars Daniel Utsch[_2_] Excel Discussion (Misc queries) 3 December 14th 08 07:17 PM
Qualifying OptionButton with ro without MSForms augustus Excel Programming 2 January 31st 05 04:37 PM
Excel 2003 Commandbars Walt Weber[_2_] Excel Programming 7 August 21st 04 11:18 PM
Qualifying sub names Bura Tino Excel Programming 2 April 21st 04 02:30 PM


All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"