Originally Posted by
LJMetzger
I don't understand either. When I wrote the code, I was unsuccessful doing both at the same time.
I don't think I ever needed that capability.
I need to create the combobox at design time, which is a one time only item.
At runtime, I need to populate the ComboBox and Enable Events which I am able to do at the same time.
------
If you are still having problems after a couple of days, I suggest you close this thread (because it will probably not generate any more responses for you), and open a new thread with a reference (link) to this thread.
I'm sorry I wasn't able to help more.
Lewis
@LJMetzger, just out of interest, can you test the attached modification of your document?
I modified it to add the controls and populate the collection in one loop.
I found that minimising the references to the ActiveWorksheet object fixed the problem.
Generally speaking the spreadsheet will be re-built whenever a control is added and this causes the global variables to be reset if they carry references to the worksheet.
Any objects, including collections that are in the WorkSheet module will be reset. Normally, if you have the code in a standard module it will be OK.
With this in mind I added this line to your CreateComboboxes routine...
and then replaced any references to ActiveSheet with ws in the code.
I then added in the extra lines to manage the collection like so...
And it works reliably.
Bookmarks