Search code examples
c#excelazureazure-worker-rolesazure-cloud-services

Best way to read and write Excel with no dependencies on Azure Cloud Service?


I want to read and write excel file with extensions: .xls and .xlsx (Generated from any office version i.e. Office 2003, Office 2016).

I have read and written Excel with office interop, it is working fine at local environment but once I hosted on Azure Cloud Service Worker Role, it is not working(Need office interop dependency).

Please suggest me best way to read and write excel with no dependencies in Azure environment?


Solution

  • You should use OpenXML or ClosedXML.

    It's probably easiest to start with ClosedXML, which builds upon OpenXML, and makes a lot of tasks much simpler.

    If ClosedXML does not work for older versions, you can try Excel Data Reader.

    I haven't tried it myself, but a lot of people recommend it.

    Not sure about the support for Office 2003 though. You'll have to check for that.