I have a server that can\'t have any office installed on it, so I\'m using ClosedXML to do some manipulations on excel files. But ClosedXML only works on .xlsx file and I al
For Microsoft.Office.Interop
you need to have office installed.
You could use OleDb to read it(f.e. into a DataTable). Then use a library like EPPlus or OpenXml to write the xlsx file. Both don't need to have office installed.
Creating an xlsx file from a DataTable
with EPPLus is easy:
using (ExcelPackage pck = new ExcelPackage(newFile))
{
ExcelWorksheet ws = pck.Workbook.Worksheets.Add("Name of Worksheet");
ws.Cells["A1"].LoadFromDataTable(dataTable, true);
pck.Save();
}
The first link above shows how to get a DataTable
from an xls-file.