Search code examples
.netexcel-interopepplusnpoiexcel-dna

Excel-DNA automation on server side


I have a question regarding how does Excel-DNA tools behave when used under server side scenarios. I am fully aware of Office limitation when used in server-side scenarios, but I do not know whether Excel-DNA tools could overcome this problem.

A new requirement has arisen on our application which forces us to read xlsb files, not supported either by EPPlus nor NPOI, which provides the core functionality to our application.

I plan on using excel-DNA interop functionality on the server, either to convert xlsb to friendlier xlsm format, or directly read these files.

Could you please provide me feedback regarding this possible solution, or, if possible, open source alternatives on how to read xlsb files?


FYI: Our current scenario is a web application which receives several excel files per user, provides a user interface to allow for showing and editing data, and generates excel based reports. We do have typically 30 files per user, 10-50 MBytes each file, and 10-20 users which can upload or download excel files simultaneously.

Up until now, we have been using EPPlus, and later on, NPOI, to suppport older xls files for these tasks. Regardless, new requirements imply reading xlsb files, which are not supported so far by either EPPlus, NPOI, nor any I know of.


Solution

  • Excel-DNA is an open-source library for making Excel add-ins with .NET. It doesn't sounds like you need an Excel add-in. Rather you just need to write a script or small application that talks to Excel using the COM object model. It can then ask Excel to open the .xlsb file, and 'Save As' one of the other formats, say xlsx. Then you can do the rest of the processing with EPPlus based on the .xlsx file.

    It's hard to say what the reliability and performance of Excel would be under your intended load. I'd probably suggest you find a way to start a new Excel process for each conversion.

    EasyXLS is a commercial option - they have a .NET library and seem to support reading and writing .xlsb files. It looks suitable for server applications like yours.

    Otherwise it might be a fun project to create your own (maybe open-source) .xlsb processor. I see the .xlsb specification is available from Microsoft.