NetOfficeFw / NetOffice

🌌 Create add-ins and automation code for Microsoft Office applications.
MIT License
697 stars 143 forks source link

incompatibility with office 2019? #234

Closed bluewis777 closed 5 years ago

bluewis777 commented 5 years ago

I tried using NetOffice 1.7.2.0 on word 2016 and it works, but when I tried running it on word 2019, it seems that I cannot successfully quit the application by calling Application.Quit() - the app just seems to hang, and when I try to forcefully stop it, it throws the following exception:

System.Runtime.InteropServices.COMException (0x80004005): See inner exception(s) for details. ---> System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at NetOffice.Invoker.Method(COMObject comObject, String name, Object[] paramsArray) at NetOffice.Invoker.Method(COMObject comObject, String name, Object[] paramsArray) at NetOffice.WordApi._Application.Quit(Object saveChanges)

Has anyone encountered the same issue?

samatstariongroup commented 5 years ago

I have not tried on 2019, but did you notice that a newer version is available on nuget? https://www.nuget.org/packages/NetOfficeFw.Core/1.7.4.5

jozefizso commented 5 years ago

Please, try the Word samples from https://github.com/NetOfficeFw/Samples

NetOffice works with Office 2019. The reported exception is from the COM server, which is not responding. That indicates issue with the automation code.

maliutin commented 5 years ago

As I understood, Word, Excel and PowerPoint are the same 16.0 version as in Office 2016. You can see it in the About window.

bluewis777 commented 5 years ago

Thanks guys, I updated to the latest version (1.7.4.5) of netofficefw (using visual studio 2013 express) and now it works fine