ComboBox errors part 3

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

ComboBox errors part 3
Accessing ComboBox.ListCount on disabled combobox throws 
Stig Nielsson




Posts: 31
Joined: 2006-11-13
An unspecified COM exception is thrown when accessing a ComboBox where Enabled == false.

The exception is (Exception from HRESULT: 0x80004005 (E_FAIL))

Is this a known issue, and is there a fix or work around ?

/Stig

Posted 30 Dec, 2006 07:12:20 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Stig, you get the exception because the combo box is not connected to the Office control. Can you please send me the code? I will test it on my PC.


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 30 Dec, 2006 10:15:26 Top
Will Morgan




Posts: 23
Joined: 2006-12-11
This happens in my code as well. It's easy enough to recreate. If you set your combobox to Enabled=false all of you properties have COM exceptions in the watch window. Set Enabled=true everything works again. The information is always there in the base.
Posted 08 Jan, 2007 12:43:39 Top
Sergey Grischenko


Add-in Express team


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

For some reason MS Office Object Model doesn't allow us to access control's properties if it is disabled.
Posted 09 Jan, 2007 07:50:50 Top