We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Check if excel is already open

Hi Team,

I have a scenario in which which i am uploading excel files and i want to validate that excel file and throw error if it is already open.

Is it possible to check using aspose.cells that uploaded excel file is already open?

Thanks in advance,


Thanks for your query.

Well, you may accomplish the task by simply obtaining the file into streams with proper accessibility, see the sample code for your reference:
Sample code:

//Creating a file stream containing the Excel file to be opened
FileStream fstream = new FileStream(“e:\test2\sample.xlsx”, FileMode.Open, FileAccess.Write);

//Instantiating a Workbook object
Workbook workbook = new Workbook(fstream);
catch (Exception ee)

If the file is already opened by other process or you have already opened it into MS Excel manually, it would throw an exception.

Hope, this helps a bit.

Thank you.


Just Google it and you’ll find links such as the following:


Good to know that you got your desired way to achieve your requirements. In case of any query, comments or issue regarding Aspose.Cells APIs, let us know and we will be glad to assist you soon.

Thank you.