0

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.

Javi bl
  • 83
  • 2
  • 7

1 Answers1

0

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.

Govert
  • 16,387
  • 4
  • 60
  • 70
  • That was precisely the idea; to use the "SaveAs" method from Microsoft.Interop.Excel libraries. I was hoping that excel-DNA could behave better than directly using Office Interop libraries. Are there any significant difference between office and excel-DNA? – Javi bl Mar 24 '15 at 22:16
  • Another question: what about using an approach similar to this one (http://stackoverflow.com/questions/29234231/c-sharp-convert-xls-file-to-xlsx-without-office-components/29234374#29234374)? Maybe I can convert the xlsb file to xlsm with this approach... – Javi bl Mar 24 '15 at 22:51
  • OK, thanks for your answer; I was using Excel-DNA Interop libraries in my project instead of Excel-DNA, thus my confussion regarding @Govert reply. I will try to isolate each Interop Excel application instance from the other, or add a synchronous lock in the worst case scenario to perform xlsb conversion. In the meantime, I will take a look at Easy XLS, as you suggested, and will probably NOT implement a xlsb processor :). Thanks again. – Javi bl Mar 25 '15 at 12:02