Wednesday, March 27, 2019

How to auto-open the VBA Editor when Excel starts

This post explains how to auto-open the VBA Editor when Excel starts using excel macro technique. To have the VBA Editor automatically open when Excel starts, add the code below to the ThisWorkbook module:

How to auto-open the VBA Editor when Excel starts

Step-1 : Open VBA Editor by pressing ALT + F11.

Step-2 : Double-click ThisWorkbook and select Workbook in the left drop-down.

Step-3 : The Open declaration should initiate and populate the first and last lines of a Workbook_Open procedure for you.

Step-4 : Save as "Excel Macro-Enabled workbook" and close the excel sheet.

How to auto-open the VBA Editor when Excel starts


Step-5 : Open the excel again and it will auto-open the VBA Editor when Excel starts.

Private Sub Workbook_Open()
 
    Application.VBE.MainWindow.Visible = True
    Application.VBE.Windows("Immediate").Visible = True
    ThisWorkbook.VBProject.VBComponents("Module1").Activate
 
End Sub

Screenshot while  adding VBA code in VBA Editor.
How to auto-open the VBA Editor when Excel starts


This is all about auto-open the VBA Editor when Excel starts using excel macro. Thank you for reading this article, and if you have any problem, have a another better useful solution about this article, please write message in the comment section.


No comments:

Post a Comment