0

I wantted to insert data an excel after that read calculated values.But this program will work on microsoft server.So Interop service not quite well for that.I looked OleDb ant another services but none of them cant calculate.

I will get values than put excel after calculation i get calculated values to my program.

I did this situation with interop but there is problem with windows server.Can i do this with different style?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
egehan
  • 11
  • 1
  • 1
    [ClosedXml ?](https://github.com/ClosedXML/ClosedXML) – Max Aug 24 '21 at 14:41
  • You want excel to calculate values for you, but you don't want to run excel? Pick one. – Jeremy Lakeman Aug 26 '21 at 01:00
  • You might want to check this: https://github.com/eiceblue/Spire.XLS-for-.NET/blob/master/CS-Examples/12_Formulas/CalculateFormulas.cs – Dheeraj Malik Aug 26 '21 at 02:41
  • @JeremyLakeman Yes i want excel to calculate.Becasue i will run the program on microsoft server so exactly i dont want run excel. – egehan Aug 26 '21 at 05:36
  • @Max i guess i tried it – egehan Aug 26 '21 at 05:38
  • @Dheeraj Malik i will take a look thank you – egehan Aug 26 '21 at 05:38
  • @DheerajMalik i looked but there is 17 sheet formula on my excel. my company dont want to share excel file to employees.They want just front face design,so i will send values excel excel will calculate and i will read it back on microsoft server. – egehan Aug 26 '21 at 05:43
  • Building a new system around an excel spreadsheet is a really bad idea. The best option is to use the spreadsheet as a specification and source of unit tests. Then reimplement everything. – Jeremy Lakeman Aug 27 '21 at 01:23

1 Answers1

0

You may consider using the Open XML SDK which allows recalculating sheets by using the following code:

spreadSheet.WorkbookPart.Workbook.CalculationProperties.ForceFullCalculation = true;
spreadSheet.WorkbookPart.Workbook.CalculationProperties.FullCalculationOnLoad = true;

See OpenXML SDK: Make Excel recalculate formula for more information.

Also you may consider using third-party components designed for the server-side execution.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45