Clearing the Items collection of a combobox fails

Add-in Express™ Support Service
That's what is more important than anything else

Clearing the Items collection of a combobox fails
 
Stig Nielsson




Posts: 31
Joined: 2006-11-13
I sometimes get a COM exception when I attempt to clear the Items collection of an ADXCommandBarCombobox

The COM exception is something with a bad index:
(Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))

The code that fails is this:

if (comboBox.Items.Count > 0)
comboBox.Items.Clear();

I don't get this, as I am not using any indexes. Why is this exception thrown?
Posted 28 Dec, 2006 11:48:00 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Stig.

Does the issue still exist? It can happen when the combo box is disabled and you are trying to clear it.

P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 08 Jan, 2007 11:14:06 Top