"Method 'Add' of object 'INodes' failed" in TreeView.
I have a TreeView on a UserForm, and a load/reload button.
When the form comes up, the user can click the button which loads the tree. He can click the button later too, which clears and reloads the tree. The code for both first and subsequent loads is: TreeView1.Nodes.Clear Set MyRoot = TreeView1.Nodes.Add(Text:="The root") AddManyMoreNodesUnder(MyRoot) ....etc. Until today, it worked fine every time. I must've done something to break it. Now, adding the first (root) node to the tree works once, but on clearing the tree and doing it again it fails on the Nodes.Add line: Run-time error '-2147417848 (80010108)' Method 'Add' of object 'INodes' failed In the watch window, all properties of TreeView seem to have the same state both times. Nor is there a problem with TreeView.Nodes--it exists and count is 0 both times. I can't think of what else to compare or diagnose. Anyone? Thanks. *** |
"Method 'Add' of object 'INodes' failed" in TreeView.
Hi Baobob,
Try downloading and running Rob Bovey's 'must have' CodeCleaner add-i n: VBA Code Cleaner http://www.appspro.com/Utilities/CodeCleaner.htm --- Regards. Norman wrote in message ... I have a TreeView on a UserForm, and a load/reload button. When the form comes up, the user can click the button which loads the tree. He can click the button later too, which clears and reloads the tree. The code for both first and subsequent loads is: TreeView1.Nodes.Clear Set MyRoot = TreeView1.Nodes.Add(Text:="The root") AddManyMoreNodesUnder(MyRoot) ...etc. Until today, it worked fine every time. I must've done something to break it. Now, adding the first (root) node to the tree works once, but on clearing the tree and doing it again it fails on the Nodes.Add line: Run-time error '-2147417848 (80010108)' Method 'Add' of object 'INodes' failed In the watch window, all properties of TreeView seem to have the same state both times. Nor is there a problem with TreeView.Nodes--it exists and count is 0 both times. I can't think of what else to compare or diagnose. Anyone? Thanks. *** |
All times are GMT +1. The time now is 01:22 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com