Function expandPath() does not work if the tree node is 'hidden' in the tree view. You need to scroll/enlarge the tree view to select the node. Same as for collapsePath().