I am opening multiple excel files in my application. Some will be automatically open when the application starts whereas some are opening at the run time.
Now I want to get data from an excel file on a button click. But before opening it, I want to check that excel file is already open.
- If it is open, I want to read from it directly.
- if it is not open, I want to open it and read from it.
But in both the cases I don't want to close the file after reading.`
I am using this method to open excel file.
objExcel = new Excel.ApplicationClass();
objWorkbook = objExcel.Workbooks.Open(...);`
Please help I am new to C#.