Userforms
When writing applications for the Visual Basic Editor you will obviously want any userforms to be displayed in the VBE editor window and not in the application window.
The easiest way to achieve this is to hide the application window, display the userform and then display the application window again.
This finds the workbook that corresponds to the active VB project.
The Close routine presents us with a new challenge
We are adding a Close Workbook menu item to the popup menu for the Project Explorer and hence need to determine which VBProject was clicked.
The ActiveVBProject property of the VBE provides this, but a way is needed to get from the VBProject object to the workbook containing it.
Can this be used to remove the spurious VB projects.
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext