This project has moved and is read-only. For the latest updates, please go here.

Class not exists: NetOffice.OfficeApi.ComboBox

Jul 30, 2013 at 2:26 PM
Hi there

I'm about to access ActiveX controls by NetOffice. Using the following code:
Excel.OLEObjects objs = (Excel.OLEObjects)((Excel.Worksheet)ActiveWorkbook.ActiveSheet).OLEObjects(System.Reflection.Missing.Value);

The following exception is thrown: "Class not exists: NetOffice.OfficeApi.ComboBox"

Does anyone have an idea what is going on?
Thank you
Aug 5, 2013 at 9:20 PM
Edited Aug 5, 2013 at 9:33 PM
i'm wondering about the (ComboBox) cast. NetOffice doesnt contains a class with these name(except in the AccessApi namespace). where ist that from?


EDIT: i try to reproduce your scenario but it fails.
please contact via skype when its possible(username:public.Sebastian)
Aug 7, 2013 at 7:59 AM
ComboBox is from Microsoft.Vbe.Interop.Forms.

Actually the cast is not necessary. This is already causing the excpetion: (Excel.OLEObject)objs["combo1"])
NetOffice is trying to cast it to a NetOffice.OfficeApi.ComboBox
Aug 8, 2013 at 11:44 PM
hello again,

as hotfix please use:

using Vbe = Microsoft.Vbe.Interop.Forms;
Vbe.ComboBox comboBox = Invoker.PropertyGet(oleObject, "Object") as Vbe.ComboBox;
// stuff

please keep in your mind. Microsoft.Vbe.Interop.Forms is not NetOffice,

what i have to do is mark the Object property as non-analyzing property or much better, spend a NetOffice wrapper assembly for Microsoft.Vbe.Interop.Forms. added to todo-list for NO 1.6.1

thanks man for pointing this out!
Aug 9, 2013 at 10:04 AM
thank you sebastian.

we will use this workaround to acces activex components.
and we will check future releases for fixes.