C# dataTable/Html to xls When export and then opened by Excel and using the save and send as attachments the file format changes to xlsb how to prevent this?
My code is similar to the working exemple in this links
Export HTML Table to Excel using ASP.NET
My code Similar to that system of doing that
string contentType = "application/excel";
Response.ContentType = I tried different types;
Response.AddHeader("Content-Disposition", "attachment; filename=myFile.xls );
Response.Write(stringData);
Response.Flush();
Response.End();
The file exported as xls but when I open it and select save and send as attachments to Outlook it transform to xlsb
I actually somehow changed it to export as xlsx with different content type but the code was not saved and I don't remember how It was made and now as xlsx it tell me that the file currept and won't able to open
I don't want to use Microsoft Office library or other library's
I Want it to stay xls or to able to open as xlsx