Excel Treeview expanding on Auto Save

Hi,

I have a treeView popualted with data in an excel spreadsheet. What I'm finding is everytime I press Save or the Auto Save feature kicks in all the Nodes on the TreeView are expanded. Is this a way to prevent this happening as there are many levels of Nodes and you can easily lose track of where you were if the Auto Save feature is activated while your selecting items in the treeView

Thanks

gavin
victoriaharryAsked:
Who is Participating?
 
NorieConnect With a Mentor VBA ExpertCommented:
The change event of the combobox might be getting triggered by save.

Actually it might not be the save itself that causes it but the automatic calculation that happens when a worksheet is saved.

Calculation could be triggering the combobox.
0
 
NorieVBA ExpertCommented:
Gavin

How and when is the treeview been populated?

Is it from some source that could be affected by calculation? eg cells with formulas, dynamic named ranges.
0
 
victoriaharryAuthor Commented:
Everytime a specific comboBox is changed I populate the treeview from data outside of Excel. The treeview can sit there and not be touched then when the Auto save kicks in it will expand all the nodes. very annoying.
To answer your question there is no reference in the treeview to any excel cells, ranges, etc. When the comboBox is changed I connect to the external source and build the treeview then close the connection
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
andrewssd3Commented:
Do you have any code that is handling one of the workbook_beforesave type events?
0
 
victoriaharryAuthor Commented:
No, the only event I'm using for the workbook is Workbook_Open() which sets a few default values for me and the Workbook_deactivate() which sets Application.DisplayFormulaBar = True

Gavin
0
 
NorieVBA ExpertCommented:
Gavin

Same question really but for the comboboxes.

I'm wondering  if there is something triggered by calculation or save that causes the behaviour you describe.

That could be the change event of the combobox.

0
 
victoriaharryAuthor Commented:
If a combobox is changed then it will trigger an event to populate the treeview. What I'm finding is if I leave the computer alone (ie, go to lunch) when I get back the auto save would of kicked in several times and all the nodes in the treeview would be expanded.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.