I'm using the sample code below to create a spreadsheet using EPPlus.dll
, but FileInfo
is not recognized.
EPPlus.dll
has been added as a reference via the Package Manager Console and the other objects and references such as ExcelPackage
and ExcelWorksheet
are correctly recognized, but FileInfo
has the swiggly redline underneath it stating that Type or Namespace cannot be found.
Any thoughts as to why?
- .Net Framework 4
c#
using OfficeOpenXml; using (ExcelPackage xlWorkBook = new ExcelPackage()) { ExcelWorksheet sheet = xlWorkBook.Workbook.Worksheets.Add("MySheet"); sheet.Cells["A1"].Value = "testing"; xlWorkBook.SaveAs(new FileInfo(@"c:\myworkbook.xlsx")); }