Excel Automation through Windows Service written in C# fails in Office 365 installed machines -
i working windows service written in c#. through windows service automating excel in programmatic way.
excel.application excel = excel.application();
this code working fine versions of excel (2003, 2007, 2010, 2013). have installed office 365 in machine. getting below exception when automate excel using above call:
retrieving com class factory component clsid {00024500-0000-0000-c000-000000000046} failed due following error: 80080005 server execution failed (exception hresult: 0x80080005 (co_e_server_exec_failure)).
can let me know, there special consideration should taken when automating office 365 excel via windows service?
microsoft not recommend, , not support, automation of microsoft office applications unattended, non-interactive client application or component (including asp, asp.net, dcom, , nt services), because office may exhibit unstable behavior and/or deadlock when office run in environment.
if building solution runs in server-side context, should try use components have been made safe unattended execution. or, should try find alternatives allow @ least part of code run client-side. if use office application server-side solution, application lack many of necessary capabilities run successfully. additionally, taking risks stability of overall solution. read more in considerations server-side automation of office article.
you may consider using open xml sdk instead, see ews managed api, ews, , web services in exchange more information. or third-party components designed server-side execution.
Comments
Post a Comment