I am trying to use Aspose Excel for the first time and I am having trouble getting it to work. I have a website that needs to generate an excel file and open it in a new window. I want it to work something like the following code would work:
Response.Clear();
Response.Buffer= true;
Response.ContentType = “application/vnd.ms-excel”;
Response.Write(“
| Test |
Response.End();
Here is how I have tried to do this with Aspose:
Excel ExcelDocument = new Excel();
Cell cell1 = ExcelDocument.Worksheets[0].Cells[“A1”];
cell1.PutValue(“test”);
ExcelDocument.Save(“test.xls”, Aspose.Excel.SaveType.OpenInExcel, Aspose.Excel.FileFormatType.Default, Response);
When this opens Excel it gives me the error message “Unable to read file” and opens a blank worksheet. Could you please tell me what I am doing wrong.
Thanks