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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





73864 May 23,2008 01:06 AM UTC Mar 15,2010 06:57 AM UTC ASP.NET Web Forms (Classic) 7
Tags: XlsIO
Asked On May 23, 2008 01:06 AM UTC

I have an app where I am experiencing random NullReferenceExceptions in the Finalize method of the ExcelEngine, as well as numerous other random and impossible to consistently reproduce Syncfusion exceptions.

I created some sample code which throws a NullReferenceException on the Workbook.Close.

When the ExcelEngine is moved to the class level alongside the workbook object, the problem goes away.

This is not exactly the same issue as I am experiencing but I thought it might be related.

I noticed in some of the Syncfusion sample code that they are declaring the ExcelEngine inside a function and then returning a workbook/worksheets from that function. I assume then that I should in theory be able to let my ExcelEngine go out of scope and still be able to use my Workbook and vice versa? I experience problems with my app regardless of whether I am calling Dispose methods and setting objects to nothing after use.

This is happening with version 6.2 and with the previous version.


Replied On May 23, 2008 05:39 AM UTC

I'll just add that I ran the sample code again several times this afternoon with the following results:

On one occasion the code worked.
On several other occasions I got the NullReferenceException again (seems to happen particularly when I set a breakpoint on the Workbook.Close)
On other occasions I got a variety of different errors.

Yavanaarasi G [Syncfusion]
Replied On May 26, 2008 11:44 AM UTC

Hi Sarah,

Thank you for your interest in Syncfusion products.

I am able to see the issue that you have mentioned. But the issue is not because of XlSIO. The issue reproduced only with your sample. Your class file can be called wrongly. I have created a new sample with class file and called the function here no exception thrown. Please refer the sample in the below link:


Please try to check your code and let me the issue still exists.


Replied On May 27, 2008 06:49 AM UTC

Thanks, but I am wondering why the name of my class would be relevant to Xlsio?

It seems you changed the case of the class and one of the functions? I tried changing this in my own sample project and it now works most but not all of the time. I also found I can change the class name back again and it will continue to work (most of the time).

The sample project you sent me is still giving me the same exceptions. Occasionally, it will also work for a while.

I think the renaming of the class is having some side effect which is temporarily causing the problem to go away, but I don't think it is the root cause of the problem. Also note that the classes in my real app have different names and still experience the problem.


Yavanaarasi G [Syncfusion]
Replied On May 28, 2008 12:48 PM UTC

Hi Sarah,

It seems like another forum that you are created regarding this issue. Could you please provide the stack trace for this issue also?


Replied On May 29, 2008 12:27 AM UTC

Details of the exception(s) in relation to this issue are attached. This is a seperate issue to my other post. Thanks

Error Details.zip

Yavanaarasi G [Syncfusion]
Replied On May 29, 2008 11:46 AM UTC

Hi Sarah,

Thank you for providing the details.

We have forwarded the stack trace to our development team. Also please provide the sample image it will be helpful to reproduce the issue in our side.


JiSoo Hong
Replied On March 15, 2010 06:57 AM UTC

Hi there,

VERSION: Syncfusion Essential Studio User Interface 2009 Vol 4 (V7.4.0.20)

I am trying to make an excel file using ExcelEngine.

In my computer (Win XP), it works FINE.
However, I got an exception error as attached through the WEB SERVER(WIN 2003 Server).

I copied the following files in the bin directory of WEB SERVER:

Again, Syncfusion and MS Excel are not installed in the WEB SERVER. (Is it OK??)

The following is a sample code I tried.

============== source code =======
private void ExportExcel()
//A new instance of Excel Application is created
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;

//A new workbook object is created
IWorkbook myWorkbook = excelEngine.Excel.Workbooks.Add();
IWorksheet mySheet = myWorkbook.Worksheets[0];
mySheet.Name = "Weekly";

int i, j;
for (i = 1; i <= 20; i++)
for (j = 1; j <= 20; j++)
IRange xlRange = mySheet.Range[i, j];
xlRange.Value = string.Format("({0}, {1})", i, j);

string sXlFileName = "test.xls";
myWorkbook.SaveAs(sXlFileName, ExcelSaveType.SaveAsXLS, Response, ExcelDownloadType.PromptDialog);

Thanks in advance.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon