VB and VBA Users Source Code: Force Excel's VBA Editor to Open
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Force Excel's VBA Editor to Open
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Thursday, September 14, 2000
Hits:
958
Category:
Office
Article:
If the VBA editor has the ALT+F11 functionality disabled and the VBA Editor menu item has been deleted, then the following code will open the VBA editor. Note, I have not added code to control in which in instance of Excel the editor will be opened, so you may need to run the code froms Word's VBA Editor: 'Purpose : Open the VBA Editor in an instance of Excel 'Inputs : N/A 'Outputs : N/A 'Author : Andrewb 'Date : 14/09/2000 'Notes : This will open the VBA Editor in an arbitary copy of Excel 'Revisions : Sub OpenVBAEditor() Dim ExApp As Object On Error Resume Next Set ExApp = GetObject(, "Excel.Application") If Not ExApp Is Nothing Then ExApp.VBE.MainWindow.WindowState = 2 'vbext_ws_Maximize ExApp.VBE.MainWindow.Visible = True ExApp.OnKey "%{F11}" 'Restore the F11 functionality MsgBox "VBA Editor opened!", vbSystemModal + vbInformation Else MsgBox "Excel is not running", vbInformation End If End Sub
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder