• VBA Editor Windows Bloat (2000 (9.0.4402 SR-1))

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » VBA Editor Windows Bloat (2000 (9.0.4402 SR-1))

    Author
    Topic
    #386337

    After editing a VBA module, I tend to close the Visual Basic Editor without closing the module I’ve been working with first. When I come back to the editor, this module is still open. Over time, these open modules tend to build up resulting in scads of open windows in the editor. Periodically, I take a time out and close them all. This is just a little annoyance — is there an easy way to have the editor to start up with only the requested module open (or, alternatively, close all open modules before closing the editor window itself)? If not, I guess I’ll just have to train myself to close ’em myself.

    Thanks.

    Viewing 1 reply thread
    Author
    Replies
    • #670027

      I don’t know of a built-in way to close all open modules, but the following simple function will do that:

      Function CloseAllModules()
      Dim i As Integer
      For i = Modules.Count – 1 To 0 Step -1
      DoCmd.Close acModule, Modules(i).Name
      Next i

      You’d have to copy this to each database, or if you want it to be available in every database, put it into an add-in. Although creating an add-in for just a single function seems overdone, I have attached one to demonstratie that is is possible. If you install it (in Access itself, not in the Visual Basic Editor), it will add an item to the Add-ins menu.

      • #670332

        Hans,

        Thanks for the tip and the add-in example! Yet another above-and-beyond-the-call response!!!

    • #670237

      In 2000 and later, the modules are loaded anyhow, whether they are “open” in the VBE or not. I simply use the project explorer or the Windows menu to find the code container I need and don’t worry about closing them, especially since they open right back up again when you open a form or report or call a routine from a module. shrug

    Viewing 1 reply thread
    Reply To: VBA Editor Windows Bloat (2000 (9.0.4402 SR-1))

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: