Opening, computing, closing MS Excel spreadsheets without installing Excel [EPPlus]

I use EPPlus to create spreadsheets (reports). In my application, each new document first opens an older report to get previous results. The problem is getting data from cells containing formulas - unfortunately, EPPlus does not have a computational mechanism . For it to work, I need to open the old report in Excel, save the changes (formulas are calculated), and then the new report is created correctly. If I do not, the values ​​from the cells of the formula are empty.

  • Is there a way to simulate (not do it manually, but with code) opening, calculating, closing an Excel table without excel installed?
  • Any ideas how to deal with it?
+4
source share
3 answers
+4
source

http://www.microsoft.com/en-us/download/details.aspx?id=5124

OpenXML is what I used when I did not have access to Office ... you can create office documents using it without having Office on your machine ... For me there was a learning curve and a lot of search queries to figure it out.

I still don't know all the details, but it worked for what I needed to do.

+1
source
  • "Microsoft does not currently recommend or support the automation of Microsoft Office applications from any raw, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT services) because Office may exhibit unstable behavior and / or deadlocks when Office works in this environment ".... but at the same time they provide a lot of useful links to OpenXML manipulation - worth a visit.

  • http://www.spreadsheetgear.com/ - but it’s very expensive, $ 999 / subscription

  • NPOI (C # Apache POI Port - Java API for Microsoft Documents). The Java version can read the calculated values , so perhaps the C # version can also.

  • Office Integration Pack - I don't know if it can calculate

0
source

Source: https://habr.com/ru/post/1381661/


All Articles