Hi again,
In the VBA Editor, create a Reference (Tools >> References...) to "Microsoft Visual Basic for Applications Extensibility n.n" and then insert the following code into the "ThisWorkbook" VBA CodeModule of a new workbook:
Option Explicit
Private Sub Workbook_Open()
Dim wdo As VBIDE.Window
For Each wdo In Application.VBE.Windows
With wdo
If .Type = vbext_wt_CodeWindow Or _
.Type = vbext_wt_Designer Then
wdo.Close
End If
End With
Next wdo
ThisWorkbook.Close SaveChanges:=False
End Sub
The above routine will close all CodeModule and Form windows in the VB Editor.
To fully achieve what you're looking for you will need to save the above workbook in the folder specified in the StartUp or Alternate StartUp File Location, so that it is opened every time Excel starts.
Hope this helps - please let me know how you get on with it.
Regards,
Greg M
Bookmarks