Hello,
I have created a excel file in the 2007 xlsx format. Below is the code I u
Dim workSheet As Cells.Worksheet = workbook.Worksheets(0)
workSheet.Name = "Test"
workSheet.Cells.ImportDataTable(dtInput, True, "A1")'dtInput is the dataset that contains data.
workSheet.AutoFitColumns()
Dim stream As New System.IO.MemoryStream
workbook.Save(stream, Cells.SaveFormat.Excel97To2003)
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.AddHeader("cache-control", "private")
HttpContext.Current.Response.AddHeader("Content-disposition", "attachment; filename=Test.xlsx;")
HttpContext.Current.Response.AddHeader("Content-type", "application/vnd.ms-excel")
stream.WriteTo(HttpContext.Current.Response.OutputStream)
Response.Flush()
When I try and open the workbook. Excel displays the following message box:
Excel found unreadable content in 'Test.xlsx'. Do you want to recover the contents of
this workbook? If you trust the source of this workbook, click Yes.
I tried saving the same file in xls format and tried opening the file , then there is no error message getting displayed.
It is happening only when I save it as 2007 xlsx format.
Could you please help me in this..I am using Aspose.Cells version 5.1.3.0
Thanks