VBE Toolbars and Windows

B

BillCPA

I know you can reference the different VB windows with VB code - is there
some way to reference the toolbars in the VB Editor window?

Also, the whole, overall window that appears when you enter the VB Editor -
is this the '....VBE.MainWindow'?
 
P

Peter T

BillCPA said:
I know you can reference the different VB windows with VB code - is there
some way to reference the toolbars in the VB Editor window?

Dim objVBE As VBE
Dim cbr As CommandBar
Set objVBE = Excel.Application.VBE
Set bars = objVBE.CommandBars
For Each cbr In objVBE.CommandBars
Debug.Print cbr.Name
Next
Set cbr = objVBE.CommandBars("Menu Bar")
Debug.Print cbr.Name

Also, the whole, overall window that appears when you enter the VB
Editor -
is this the '....VBE.MainWindow'?

Yes
also look at
For Each W in objVBE.Windows

Regards,
Peter T
 
C

Chip Pearson

Application.VBE.CommandBars is the root of all command and menu bars
in the VBA Editor. Yes, Application.VBE.MainWindow is the editor's
main application window.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top