Code to collapse Projects in VBA Project window

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Code to collapse Projects in VBA Project window

Post by Rudi »

Hi,

Strange request, but is there a way to use VBA to automatically collapse all the projects in the VBA project window.
Often times I need to insert a new module into the current file and before I can, I have to collapse (or scroll) to find the active workbook project in order to insert the module. If the projects can all stay collapsed it would help...

Any ideas for code that triggers on VBA editor open?
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78438
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Code to collapse Projects in VBA Project window

Post by HansV »

Are you referring to the Project Explorer (see screenshot)?
S0731.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Code to collapse Projects in VBA Project window

Post by Rudi »

Yes
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78438
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Code to collapse Projects in VBA Project window

Post by HansV »

The free add-in MZ-Tools 3.0 has 'Collapse Projects' among its features:
S0732.png
See the first reply in VBE How to collapse worksheets by default for an example of the code needed to collapse projects.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Code to collapse Projects in VBA Project window

Post by Rudi »

TX.
I'll give MZ-Tools a go again. I had it in the past and since I upgraded to Office 2013 some while back, I have never re-installed it.
Cheers
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.