We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Export 97-2003 .xls file

Hi , everyone
I have a job in Taiwan
I want to export 97-2003 .xls file
and  upload file to AAA Server 
so I write code :

Dim loadOptions As New Aspose.Cells.LoadOptions(Aspose.Cells.LoadFormat.Excel97To2003)

Dim wb As Aspose.Cells.Workbook = New Aspose.Cells.Workbook(stream, loadOptions)
.....
.....(write data into file)
.....
wb.Save(Me.Response, "CABatchPay2Of1.xls", Aspose.Cells.ContentDisposition.Attachment, New Aspose.Cells.XlsSaveOptions(Aspose.Cells.SaveFormat.Excel97To2003))
Response.End()
stream.Close()

but AAA Server response "It is not correct 97-2003 .xls file"
The program where I was wrong?
thanks

Michael (Come from Taiwan)

Hi Michael,

Thanks for your posting, best wishes to your job and considering Aspose.Cells.

Your code looks fine and there shouldn’t be any problem. Did you try your code with some other excel (.xls) files? Does this error occur with every .xls file? or with specific .xls file. If it is occurring for specific .xls file, please attach it here for our investigation. We will look into it and help you asap.

Besides, we recommend you to download and try the latest version: Aspose.Cells
for .NET v8.6.0.5
and see if it makes any difference.


My code :
Dim stream As New IO.FileStream(Server.MapPath("~/Download/2Of1ADD.xls"), IO.FileMode.Open)
Dim loadOptions As New Aspose.Cells.LoadOptions(Aspose.Cells.LoadFormat.Excel97To2003)
Dim wb As Aspose.Cells.Workbook = New Aspose.Cells.Workbook(stream, loadOptions)
Dim sheet As Aspose.Cells.Worksheet = wb.Worksheets("21")
...
... Add data
...
...
wb.Save(Me.Response,"CABatchPay2Of1.xls", Aspose.Cells.ContentDisposition.Inline, New Aspose.Cells.XlsSaveOptions(Aspose.Cells.SaveFormat.Excel97To2003))
stream.Close()

is Right??

Hi,

Thanks for your sample code, it looks good and using Aspose.Cells.

Please modify or adjust your code something like this and it should start working fine. Please feel free to let us know if you face any issue, we appreciate your time and efforts, learning Aspose.Cells and providing us feedback.

VB.NET


'Save file and send to client browser using selected format

If yourFileFormat = “XLS” Then

workbook.Save(HttpContext.Current.Response, “output.xls”, ContentDisposition.Attachment, New XlsSaveOptions(SaveFormat.Excel97To2003))

Else

workbook.Save(HttpContext.Current.Response, “output.xlsx”, ContentDisposition.Attachment, New OoxmlSaveOptions(SaveFormat.Xlsx))

End If


HttpContext.Current.Response.End()

I download and try the latest version Aspose.Cells for .NET v8.6.0.5 
and I was successful
thank you....
My aspose.Cells version is 8.3

Hi,

That’s great news, you were able to sort out this issue with latest version, thanks for sharing with us and using Aspose.Cells.

Let us know if you encounter any other issue, we will be glad to look into it and help you further.