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 04:47 PM UTC

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.
Up arrow icon