Determine if Excel file is open. If it is open in MS Excel, it can be closed.
isopen = xls_check_if_open(xlsfile)
isopen = xls_check_if_open(xlsfile,action)
- XLSFILE: name of the Excel file
- ACTION: 'close' (closes file if it is open) or '' (do nothing). Option 'close' only works with MS Excel.
1 if XLSFILE is open
0 if XLSFILE is not open
10 if XLSFILE was closed
11 if XLSFILE is open and could not be closed
-1 if an error occurred
Thanks a lot! Very useful function!
Good job, thanks
yeah cool function but my main problem is multiple instances of excel running, actxGetRunningServer can't see them all, just one, the first one started I think, Major pain in the neck for my application
Nice job !
Changed input and output, and screenshot