3

So i'm having an issue which is baffling me.

Originally, we have an application which gets a varying set of Values (Based on user Input), which is then sent to an .xlsx spreadsheet (Set into certain cells) and then using these values, various formulas in the Excel document perform calculations and these generate new values, which we return back to the Application and display it out to the user.

Now this document is not saved. The values are set, and then the result set is retrieved all in one go (Which worked without issue, up until the point of around 19th April, 2018) without saving the document. (We cannot save the document either, as multiple processes are accessing it, and we get "Document in Use" error after saving)

What issue we are now finding, is that as soon as the Excel Document is Opened, and formulas are updated (Or even if nothing is updated) and the document is saved, the above no longer works. We cannot set values, and retrieve a result set anymore.

The application is written in C#, with a large majority of JavaScript, however the actual access to and from the Excel Document is done in C# with use of ClosedXML.

If someone is able to shed some light on to why we are getting this issue now, it'd be most appreciated. As of now, we have reverted to an older version of the Excel Document, which has outdated formulas, and we need a way to be able to edit this Document, while being able to still perform the original functionality that we used to have.

Evendyce
  • 41
  • 3
  • 1
    `We cannot save the document either, as multiple processes are accessing it, and we get "Document in Use" error after saving` You can use `Path.GetTempFileName()` to generate unique file name and save it. BTW which version of ClosedXML you are using? – Sandeep May 08 '18 at 12:32
  • Thanks for the Response, will give this a go if all else fails. Version of ClosedXML appears to be an older version, 0.87.1. Updating it now, and hoping this could resolve it. – Evendyce May 08 '18 at 12:53
  • Unfortunately, Updating ClosedXML to version 0.92.1.0 did not resolve this issue. – Evendyce May 08 '18 at 13:01

1 Answers1

0

With this lib https://github.com/fabiooshiro/xlsx-calc you can perform simple excel calculations without saving.

Sr. Oshiro
  • 160
  • 1
  • 8