We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Excel file showing alert message "the file you are trying to open is in a different format xls" while open excel file

Hi
I have 50000 rows in my datatable and i am using following code to import datatable to worksheet to save excel file on drive
Dim worksheet As IWorksheet = workbook.Worksheets(0)
worksheet.ImportDataTable(dtExport, True, 1, 1, True)
also set format by using -worksheet.Columns(i).CellStyle.NumberFormat = "$##,###0"
but when i double click on generated excel file then it's show alert message "the file you are trying to open is in a different format xls than specified by the file extension"
Please help me out
Thanks in advance

1 Reply

AV Abirami Varadharajan Syncfusion Team October 17, 2016 10:36 AM UTC

Hi Gaurav, 
 
Thank you for contacting Syncfusion support. 
 
The issue occurs due to the mismatch of ExcelVersion and file extension. To resolve the issue, we request you to set the workbook version as ExcelVersion.Excel97to2003 for “.xls” extension. Kindly use the below code sample. 
 
Code Sample: 
 
 workbook.Version = ExcelVersion.Excel97to2003; 
 

If you are still facing the error, then kindly share us the issue reproducing sample which will be helpful for us to provide a prompt solution at the earliest. 

Please let us know if you have any concerns. 
 
Regards, 
Abirami. 


Loader.
Up arrow icon