msoControlEdit and msoControlDropdown

Jan 17, 2012 at 2:14 PM

Hi, Govert:

I wanted to consult you if you plan to define the classes for msoControlEditmsoControlDropdown.
For me they are required to migrate my VBA applications.

So far I've been extended the specific classes (CommandBarComboBox,CommandBarButton) defined in DNA with extension methods (Simple setup routines, where several parameters are defined at a time).
But I find that you have not defined the classes mentioned and related methods "AddXXX" in CommandBarControls.

So I might discard appropriate extensions and choose to use inheritance.

I wanted to consult you before proceeding.

Thank you,



Jan 17, 2012 at 4:59 PM

Sorry Govert,

I mistook the objects
I understand that: AddComboBox is specific (MsoControlType.msoControlComboBox)
I must use: CommandBarControl.Add less specific method, setting msoControlEdit,msoControlDropdown, and then I can extend msoControlComboBox to deal withdropdowns and Edit.
The last question is:
How to initialize these controls in DNA? How to invoke. DropDownLines,. DropdownWidth,.AddItem?

Jan 17, 2012 at 7:19 PM
Edited Jan 17, 2012 at 7:30 PM

Hi Marco,

If you need specialised support for the CommandBar interfaces, I suggest you add the NetOffice libraries ( to your project, and use the definitions there instead of the limited wrappers I have in the Excel-DNA code.

NetOffice is a set of version-independent interop assemblies for the Office COM interfaces, and are an alternative to using the version-specific Primary Interop Assemblies (you can use these too, but they are specific to the Excel version you target).

By using the NetOffice or PIA assemblies you'll have full access to the CommandBar interfaces, including all the events and properties. This will make your porting from VBA much easier.