NetOffice icon indicating copy to clipboard operation
NetOffice copied to clipboard

When I try to use Example # 7 (Macros), I get an error

Open 4D4N-P opened this issue 4 years ago • 0 comments

NetOffice.Exceptions.PropertyGetCOMException (0x80004005): Failed to proceed PropertyGet on Excel.Workbook=>VBProject. ---> System.Reflection.TargetInvocationException: Адресат вызова создал исключение. ---> System.Runtime.InteropServices.COMException: Исключение из HRESULT: 0x800A03EC --- Конец трассировки внутреннего стека исключений --- в System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) в System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) в NetOffice.Invoker.PropertyGet(ICOMObject comObject, String name, Object[] paramsArray) в NetOffice.Invoker.PropertyGet(ICOMObject comObject, String name, Object[] paramsArray) в NetOffice.CorePropertyGetExtensions.ExecuteKnownReferencePropertyGetInternal[T](Core value, ICOMObject caller, String name, Type knownType, Object[] validatedArgs) в NetOffice.ExcelApi._Workbook.get_VBProject() в .../.../excel() в ......\Excel.cs:line 60

Error lines: // add a new workbook Excel.Workbook workBook = excelApplication.Workbooks.Add();

// add new global Code Module VB.VBComponent globalModule = workBook.VBProject.VBComponents.Add(vbext_ComponentType.vbext_ct_StdModule);

4D4N-P avatar Mar 25 '21 10:03 4D4N-P