Reputation: 325
I have some code that is trying to convert a .xls spreadsheet into a .xlsx spreadsheet using Interop:
public void Convert(string file)
{
var app = new Microsoft.Office.Interop.Excel.Application();
var wb = app.Workbooks.Open(file);
wb.SaveAs(Filename: file + "x", FileFormat: Microsoft.Office.Interop.Excel.XlFileFormat.xlOpenXMLWorkbook);
wb.Close();
app.Quit();
}
However I am receiving an error which says that xlopenxmlworkbook' is not a member of 'microsoft.office.interop.excel.xlfileformat'
Which leads me to beileive that I cannot save a .xls file because its a Excel 2003 file and .xlsx isn't supported by Excel 2003?
I have Office 2013 installed, so should not be a problem.
Is there a way to add xlopenxmlworkbook to the dll or update it? or another workaround?
Upvotes: 0
Views: 651