This is just a post some maybe others will avoid wasting time and effort like I had to....
It seems that when reloading a listbox (in my case in ppt, but triggered from vba in excel) the ppt application (office 2010) was not highlighting the selected row in the listbox, and was infact also losing the selected row information when the item lost focus.
basic logic...
indication in excel that new data is to be displayed
triggers macro in ppt to fetch data and update:-
1. select the userform and listbox
2. fetch the data from excel worksheet range into a local array
3. save locally the current selected index in the listbox
4. reload the data into the listbox and adjust column widths
5. relocate the old selected item, and set the new selected index
after several hours of banging my head against a brick wall, i finally got the issue down to two lines of code, and the order in which they were used...
Summary of key Code lines which did not work:
Code which worked fine:![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
So in summary, if you get problems with listbox selected items not being highlighted, double check you are not re-defining column widths after loading the data into the list.....
Bookmarks