Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

Commented Unassigned: COM Exceptions in NetOffice (Excel) [21030]

$
0
0
I'm trying to port an Excel VSTO Addin over to NetOffice. So far I've got the Addin launching, but any time I try to make a call on a NetOffice object I get the following:
```
----- Source: NetOffice -----
Inner Exception 1: System.MissingMethodException: Method 'System.__ComObject.Add' not found.
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at NetOffice.Invoker.MethodReturn(COMObject comObject, String name, Object[] paramsArray)
System.Runtime.InteropServices.COMException: See inner exception(s) for details.
at NetOffice.Invoker.MethodReturn(COMObject comObject, String name, Object[] paramsArray)
at NetOffice.ExcelApi.Workbooks.Add()
at Hcg.Stinger.Connect.InitializeAutomationAddIn() in D:\Code\Prevision\Source\Hcg\Stinger\Connect.cs:line 541
at Hcg.Stinger.Connect.OnStartupComplete(Array& custom, MainTaskPane taskPane) in D:\Code\Prevision\Source\Hcg\Stinger\Connect.cs:line 258
----------
```

The code is pretty straightforward:
```
Excel.Workbook book = _excelApp.Workbooks.Add();
```

I also got the similar error when I called saying the Cursor did not exist, even though it show up in the intellisense:
```
Excel.Enums.XlMousePointer cursorOriginal = Excel.Enums.XlMousePointer.xlDefault;
_excelApp.Cursor = Excel.Enums.XlMousePointer.xlWait;
```

Ideas?

Thanks,

Erick
Comments: ** Comment from web user: SebastianDotNet **

what i need to know:

1) Excel version(32 or 64 bit)
2) NetOffice version
3) Operating system(32 or 64 bit)

at last: the operating system is a developer machine or just a user pc.

the fast way to pin point the problem is a sample solution. (send to public[at]sebastian.web.de and remove any private code, i dont need this)

*Sebastian


Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>