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

Free Support Forum - aspose.com

workbook.Save in dotnet 3.5 asp.net project produces error

In a visual studio 2008, dotnet 3.5 asp.net project I have the following code:

Dim workbook As Workbook = New Workbook()
Dim sheet As Worksheet = workbook.Worksheets(0)
Dim dtAll As Data.DataTable = getDateTable()
sheet.Cells.ImportDataTable(dtAll, True, 0, 0, dtAll.Rows.Count, dtAll.Columns.Count, False, “dd-mm-yyyy”)
workbook.Save(“List.xls”, FileFormatType.Default, SaveType.OpenInBrowser, Me.Response)

When run (regardles of what FileFormatType and SaveType I set in workbook.Save) the following javascript error (in prompt) is produced:

A Runtime Error has occurred.
Do you wish to Debug?
Line: 5252
Error: System error: -1072896748.

Debugging opens the following function “Sys$Net$XMLHttpExecutor$get_responseData()” in the file:

// Name: MicrosoftAjax.debug.js
// Assembly: System.Web.Extensions
// Version:
// FileVersion: 3.5.21022.8
//! Copyright © Microsoft Corporation. All rights reserved.
//! MicrosoftAjax.js
//! Microsoft AJAX Framework.

// JavaScript Extensions and Type System

function “Sys$Net$XMLHttpExecutor$get_responseData()” at line lines 5242 - 5253:

function Sys$Net$XMLHttpExecutor$get_responseData() {
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._responseAvailable) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, ‘get_responseData’));
if (!this._xmlHttpRequest) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, ‘get_responseData’));
return this._xmlHttpRequest.responseText;

What am I doing wrong?

I can’t find any forum threads or knowledge articles that help (may not be looking the right places).


Could you ingore all codes about Aspose.Cells and only open the file with FileStream and write it to response? See following codes:

FileStream fs = File.Open(@"F:\FileTemp\book1.xls");
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
Response.OutputStream.Write(buffer, 0, buffer.Length);

And we will check this issue on VS2008 with AJAX.