1
I’m trying to create an application that generates an Excel spreadsheet through Visual Studio 2015 using Closedxml as a reference. As I found some examples on the web, I added it to the code (using Closedxml.Excel;), downloaded the reference and added it to the project and tried to create a simple spreadsheet, as shown as an example on the Closedxml website itself (https://github.com/ClosedXML/ClosedXML).
I added the code below, but when running the program appears the error:
An unhandled Exception of type 'System.IO.Filenotfoundexception' occurred in System.Windows.Forms.dll Additional information: It was not can load file or Assembly 'Documentformat.Openxml, Version=2.5.5631.0, Culture=neutral, Publickeytoken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
var workbook = new XLWorkbook();
var worksheet = workbook.Worksheets.Add("Sample Sheet");
worksheet.Cell("A1").Value = "Hello World!";
workbook.SaveAs("HelloWorld.xlsx");
You need to configure something else in Visual Studio?
Hello, Carlos Eduardo! Really that was it! I installed the library via nuget and it worked. Thank you very much! Abs!!!
– Leandro
Good Leandro, if you need us we are there !
– Carlos Eduardo