I'm trying to create an application that generates a spreadsheet in Excel through Visual Studio 2015 using ClosedXML as a reference. As I found some examples on the web, I added the same to the code (using ClosedXML.Excel;), I downloaded the reference and added it to the project and tried to create a simple spreadsheet, as shown as an example in the ClosedXml site itself ( link ).
I added the code below, but when running the program the error appears:
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in System.Windows.Forms.dll Additional information: possible to load file or assembly 'DocumentFormat.OpenXml, Version = 2.5.5631.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 ' or one of its dependencies. The system can not 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");
Do I need to setup anything else in Visual Studio?