You can use the xlsread
function to try and open the file. If it is already open, you will get an error message. Here's an example code snippet:
main.m189 chars10 lines
This code will try to open the file with xlsread
, and if it can't because the file is already open, it will catch the error and display a message saying that the file is open.
If the file is not open and can be opened by xlsread
, then it is saved and closed.
gistlibby LogSnag