Reputation: 19
I want to export the file as an xls to Excel 2007+, why it is always saved as an Excel 97-2003 File? what I do wrong?
this is the Row that saves the file:
xlWorkBook.SaveAs(TargetFolderText.Text + "\\" + TargetFIleText.Text + ".xls");
Upvotes: 1
Views: 386
Reputation: 13338
Could you replace your code with:
xlWorkBook.SaveAs(TargetFolderText.Text + "\\" + TargetFIleText.Text + ".xlsx");
The xls
extension is for Excel 2003 and earlier.
The xlsx
extension is for Excel 2007 and later.
Use xlsm
when using macro's in Excel sheet(2007 and later)
Article about the differences between XLS and XLSX
Upvotes: 1