View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Victor[_5_] Victor[_5_] is offline
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?