Link to home
Start Free TrialLog in
Avatar of jnash67
jnash67

asked on

How can I programmatically collapse a project in Excel VBA VBE IDE

I know that MZ Tools does this.  The VBProject object can be gotten using:

application.vbe.vbprojects.item(1)

How do I collapse it in the Project Explorer?
Avatar of jnash67
jnash67

ASKER

I found the following advice from Stephen Bullen (http://www.archivum.info/microsoft.public.excel.programming/2005-05/msg00318.html)

The Microsoft Visual Basic for Applications Extensibility library
provides the object model for the VBIDE, allowing us to add menu items
to the Project Explorer popup. It doesn't, however, provide the
granularity of which nodes in the treeview are expanded. So, I guess
that MZTools uses the object model to get the window handle and Windows
API calls to find the handle of the TreeView and collapse the nodes.

How can I do this?
ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jnash67

ASKER

You rock