Application.ToggleTPAutoExpand method (Project)

Expands or collapses resource rows in the Team Planner view, where there is more than one assignment within the same time span for a resource.


expression. ToggleTPAutoExpand

expression An expression that returns an Application object.

Return value



You can manually expand or collapse the list of tasks for a single resource by choosing the + or - icon next to the resource name, or by using the ToggleTPResourceExpand method. The ToggleTPAutoExpand method does the same action for all resources.


The + or - icon does not show next to the resource name if there are no overlapping assignments for that resource.

The ToggleTPAutoExpand method corresponds to the Expand Resource Rows check box on the Format tab under Team Planner Tools in the ribbon.


In the following example, at least one resource has overlapping assignments. The ToggleResourceRows macro switches to the Team Planner view and expands or collapses the rows that have overlapping assignments. When a row is expanded, it is easier to see all of the overlapping assignments.

Sub ToggleResourceRows() 
    ViewApplyEx Name:="Team Planner" 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.