PDA

View Full Version : Solved: Open VBA Project from Excel Button



White_Nova
01-30-2008, 04:03 AM
Hi All

just a quick one...

How would i have a button in excel open the vba project using vba code?
I know its a silly question, and i know you can open it other ways, just need this specific way for my needs...

Thanks

Oorang
01-30-2008, 07:25 AM
Make sure you set the reference or it won't work :-)
Private Sub CommandButton1_Click()
'Set a reference to Microsoft Visual Basic For Applications Extensibility
'C:\Windows\System32\Fm20.dll
Dim cb As Office.CommandBar
Dim objVBE As VBIDE.vbe
Set objVBE = Excel.Application.vbe
objVBE.MainWindow.Visible = True
objVBE.MainWindow.WindowState = vbext_ws_Maximize
End Sub