How can I build a project containing Excel creation in VSTS?

0

I have a project that uses Interop Excel to build up a report. This runs just fine and the report is created every time.

The problem that I'm facing now is when published, I'm not able to run it, it is built and published but I get an exception when I try to create the Excel file with this line:

var excelApp = new Excel.Application();

The exception is the one below, I've added multiple references to assemblies but I'm not sure if maybe I'm missing some COM reference for this to run.

Unhandled Exception: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

excel
azure-devops
azure-pipelines
excel-interop
asked on Stack Overflow May 10, 2018 by fabian278 • edited May 12, 2018 by marc_s

1 Answer

0

After all, Azure app service does not allow Office. The way I took was OpenXML.

In short, we can't use it on the Azure WebApp service. There is no MS Office inter-op present on Azure WebApp service and Azure WebApp is sandbox. If we want to write and read excel file on the Azure WebApp, we could use the DocumentFormat.OpenXml as workaround.

answered on Stack Overflow May 10, 2018 by fabian278

User contributions licensed under CC BY-SA 3.0