How to check if if a or more Excel files are open? Since my program deals with many Excel files, I want to warn the user before it starts the actual execution, saying “Please save all your Excel files and close them before execution” only if the program detects an open Excel file, or more than one Excel files, and I want to exit the program.
I know there is kill process activity, but I want to warn the user in advance.
How could I do this?
Also, I want to close any open File Explorer too. How to check if there is at least one opened File Explorer?
Edit: I seem to be able to find sources where you can check if a specific Excel file is open… but it requires the path to that file. That’s not my case. I want to close any opened Excel workbooks, whose paths I don’t even know…