Link to home
Start Free TrialLog in
Avatar of hindersaliva
hindersalivaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Excel - TreeView Control - reading tree items

I have a TreeView control on a UserForm which is populated from a 'map structure' in a database table.

I can make it possible to drag and drop between nodes.

Now I want to be able to 'read' the modified TreeView so that I can upload the map back to the database.

Does anybody know how to 'read' the TreeView?
ie. from the Root read each node and child nodes etc. loop through all.
te. Extract ParentID, Name, ThisItemID.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

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 hindersaliva

ASKER

imnorie,
That's exactly what I was after. I shall load it into an array (and then have several selectable choices).

Thanks!
Avatar of Norie
Norie

No problem.

Imnorie,
I'm struggling with how to start it off.
Do you have a code sample that calls the Sub? ie. with the initial value of objNode
For me it will be the Root.

(This is exciting)

Thanks
Something like this perhaps.
Dim ptnode As Node

    Set ptnode = TreeView1.Nodes("Root")
    Call TraverseTree(ptnode)

Open in new window

This will only work if your 'root' node has the key value 'Root'.

If it has something different use that.
imnorie
Yes that worked great.
Thanks
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.