Code to launch VB editor

B

Boog

I am running XP with Office 2002.

What is the VB code to launch the VB editor.

I would like to assign it to a toolbar button. It would save time, albeit
very little, but in the world of nanoseconds and milliseconds, it is long.

I have searched newsgroups, Google and visited various websites. Chip
Pearson's site is superlative at providing code to work in the editor but I
did not locate the code to actually launch the editor. I have also used all
combinations of code in VB (ie: Application.VBE. ...) but cannot produce the
desired result.

Thank you ahead of time for your time and consideration.
 
O

Office_Novice

Sub vbe()
Application.vbe.MainWindow.Visible = True
End Sub
'Tools -->Macro-->Security
'Click the Trusted Publisher Tab
'Click Trust access to Visual Basic Project Checkbox
'Click ok
 
B

Boog

That has to be the only combination I didn't try.

Thank you for the prompt solution.

Cheers.
 
M

Martin

You could also use this:

CommandBars("Worksheet Menu
Bar").Controls("Tools").Controls("Macro").Controls("Visual Basic
Editor").accDoDefaultAction
 
B

Bernie Deitrick

Alt-F11 will also open the VBE, and takes less time than mousing over a button, if your hands are
already on the keyboard....

HTH,
Bernie
MS Excel MVP
 
B

Boog

Bernie,

I have used Alt-F11 in the past but I usually have the mouse in hand.

Thanks to all for their input.
 
B

Boog

Thank you Martin

Martin said:
You could also use this:

CommandBars("Worksheet Menu
Bar").Controls("Tools").Controls("Macro").Controls("Visual Basic
Editor").accDoDefaultAction
 

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

Similar Threads


Top