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

New Post: COM Exceptions with NetOffice

$
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

Viewing all articles
Browse latest Browse all 1741

Trending Articles



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