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

Checking Instance of File

Hi If I want to toc check the instance of file (X.xls) is it open or not? How I can do this? provide example with (Iworkbook) object.

1 Reply

AD Administrator Syncfusion Team April 19, 2005 11:47 AM

Hi Mohammad, Here is a code snippet to check for a file that already exists try { myWorkbook.SaveAs("Sample.xls"); } catch (System.Runtime.InteropServices.ExternalException ex) { if(ex.ErrorCode == -2147287007) { MessageBox.Show("The file that you are trying to create is already open","File is Open"); } } Thanks, Stephen. >Hi > > If I want to toc check the instance of file (X.xls) is it open or not? How I can do this? provide example with (Iworkbook) object.

Loader.
Live Chat Icon For mobile
Up arrow icon