Home > Back-end >  VBA/ How to close Project Explorer window with a shortcut
VBA/ How to close Project Explorer window with a shortcut

Time:03-04

Is there any way to close a Project Explorer window with a shortcut or is there an option to write a Subroutine closing this window?

CodePudding user response:

You can use a routine like this:

Sub ClosePE_Window()
   Dim w As Object
   For Each w In Application.VBE.Windows
      If LCase$(Left$(w.Caption, 10)) = "project - " Then
         w.Close
         Exit For
      End If
   Next w
End Sub
  • Related