We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

thread was being aborted error - on save

I'm executing the following code once I've created a workbook using XLSIO:

Workbook.SaveAs(sFileName, ExcelSaveType.SaveAsXLS, response, ExcelDownloadType.Open)

where sFileName is the complete path and filename.

This line of code always creates a "thread was being aborted" error. And, when the dialog to open the file appears, the filename is the webpage filename (e.g., mypage.aspx) instead of the filename being supplied.

1. Is there any way to avoid the "thread was being aborted" error?
2. How can I get the OS to use the actual filename that I'm supplying (xxx.xlsx), rather than the webpage name (mypage.aspx) when opening or saving?

1 Reply

AV Abirami Varadharajan Syncfusion Team October 31, 2019 09:07 AM

Hi Bert, 

We have invoked Response.End() method inside the Workbook.SaveAs() method to download the Excel file, so the exception occurs sometimes. As this is the known issue in ASP.NET, we have prepared sample to overcome this issue. The sample can be downloaded from following link. 
Please refer to below KB article to overcome this issue at your end. 
Kindly try and let us know if this helps. 

Live Chat Icon For mobile
Up arrow icon