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

How can I check if a worksheet object has been Close()''ed

Thread ID:





66721 Aug 1,2007 04:43 PM UTC Aug 2,2007 11:05 AM UTC ASP.NET Web Forms (Classic) 1
Tags: XlsIO
Asked On August 1, 2007 04:43 PM UTC

I think I have only hit this problem when jumping around code in the debugger but I have gotten an error when I call workbook.Close(...) more than once.

I already check that (workbook != null) but I would like to check something else to prevent an error.

I tried "(workbook.ActiveSheet != null)" but that didn't worked when the workbookk has been closed.

Any ideas?

Melba Winshia [Syncfusion]
Replied On August 2, 2007 11:05 AM UTC

Hi Scott,

Thank you for your interest in Essential XlsIO.

We do not have any API to check if a worksheet object has been closed or not. But you can you can check this by using below code snippet.


catch (System.NullReferenceException ex)
MessageBox.Show("workbook is already closed");

Please refer the sample in the below link which illustrates the above.


Please try this and let me know if this helps.



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