5

I'm using closedxml to generate and download an xlsx file from a .NET c# application

Is there a way to display the formulas output numbers without the user having to click Enable Editing after downloading and opening the file in excel?

  • You can't change that while generating the files. You have to disable Proteced View for files from the Internet in Excel itself, but that can be unsecure. See [here](https://www.cnet.com/how-to/how-to-disable-protected-view-in-microsoft-word/) and [here](https://blogs.technet.microsoft.com/office2010/2009/08/13/protected-view-in-office-2010/) for more information. – Raidri Dec 06 '17 at 09:46
  • Thank you, but is it possible to display just the output of the formulas without disabling protected view – Goran Backlund Dec 06 '17 at 10:05
  • No, the only thing you could do is to calculate the results and put them also in the file (in a seperate column for example). – Raidri Dec 06 '17 at 10:59

1 Answers1

8

There is an overload which allows you to evaluate formulas when saving the file. It's disabled by default.

void Save(Boolean validate, Boolean evaluateFormulae = false);

void SaveAs(String file, Boolean validate, Boolean evaluateFormulae = false);   
DaggeJ
  • 2,094
  • 1
  • 10
  • 22
Francois Botha
  • 4,520
  • 1
  • 34
  • 46