Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Treeview issue for fullpath statement on hidden treeviews

Status
Not open for further replies.

axel67

Technical User
Jan 2, 2007
21
Hi weekend workers....
I have an issue with the treeview control (Excel 2000). I have a couple of treeviews on a form, of which only one is visible (depending on user selection. When the form is closed (hidden), I want to extract through a worksheet function the full path of a specific node. However the function returns only for the treeview which is visible the full path. For the hidden treeviews on the form the function returns only the node name. Anyone has an idea?

Function GetTreeNodePath(LibaryName As String, DimensionName As String, DimItem As String) As Variant
Dim objTree As TreeView
'name of the treeview:
TVName = "TVDim" & LibaryName & "_" & DimensionName

Set objTree = DimensionDrill.Controls(TVName)
GetTreeNodePath = objTree.Nodes(DimItem).FullPath

End Function

Thanks,
Axel
 
and solved...
Need to add the "EnsureVisible" property to the node.


Function GetTreeNodePath(LibaryName As String, DimensionName As String, DimItem As String) As Variant
Dim objTree As TreeView
'name of the treeview:
TVName = "TVDim" & LibaryName & "_" & DimensionName

Set objTree = DimensionDrill.Controls(TVName)
objTree.Nodes(DimItem).EnsureVisible
GetTreeNodePath = objTree.Nodes(DimItem).FullPath

End Function

Cheers,
Axel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top