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

Free Support Forum - aspose.com

Problems on xls-file generation


I have a problem regarding generation of xls-files for webdownload.

This is what I am doing:

1) A xls-file is loaded from a database (SQL-Server 2005)
2) Some sheets are made invisible due to some user roles using aspose.cells
3) the xls-file will be sent to the client (IE8) using the following code:

Response.ContentType = “application/vnd.ms-excel”;
Response.AppendHeader(“content-disposition”, “attachment; filename=report.xls”);
Response.AppendHeader(“content-length”, xlsDoc.Length.ToString());



The xls-file has a macro that starts automatically when the file opens. The macro makes a SavaAs to rename the file so that it is no longer called “report.xls” but "report-[current date and time].xls. In addition, this saveas makes the downloaded and writeprotected xls file wirteable.

Everything workes fine, but:

On the system of a customer it does not. Two types of behavior occured:

1) MS Excel opens and says, that the file cannot be found after download. So, the file will be downloaded into temporary internetfiles and afterwards, Excel cannot find it.

2) The file will be downloaded correctly, but the SaveAs macro does not work. The file opens inside MS Excel, everything is there (all data) but it has the name of a new workbook and the file saved under the “SaveAs”-filename is corrupt.

I suppose, that this behavior has nothing to to with the functionallity of Aspose.Cells, but maybe, someone else had this problem before and has a solution for it and I think, there is a bigger chance to find such a person in this forum than in any other forum :slight_smile:

I tried to find out as much differences as possible between our system (where everything works ok) and the system of the customer.

our system: Server: Win XP, IIS 5.1, ASP.NET 2.0
client: Win XP, IE8, MS Excel 2003 (German)

customer system: Server: Win Server2003, IIS 6.0, ASP.NET 2.0

client: Win XP, IE8, MS Excel 2003 (English with language set to french)

Does anyone have an idea, what may be the reason for the strange behavior?

Thanks in advance!


Hi Thomas,

Thank you for the inquiry. We are performing test for the inquiry. We will get back to you with our findings as soon as possible.


Hi Thomas,

We have tried to reproduce the issue but the file downloaded correctly.

In order to find out root cause of the issue, please remove all code about Aspose.Cells. Just open the file with System.IO.FileStream, then export the file by Response to check whether this issue has been caused by Aspose.cells or not. If it all goes perfectly means, file download correctly then please post the template file you are using. We will look into it and will update you about our findings.