File Exchange

image thumbnail

Check if XLS file is open and close it

version 1.1 (2.22 KB) by

Determine if Excel file is open. If it is open in MS Excel, it can be closed.

4.66667
6 Ratings

14 Downloads

Updated

View License

Determine if Excel file is open. If it is open in MS Excel, it can be closed.

USAGE
isopen = xls_check_if_open(xlsfile)
isopen = xls_check_if_open(xlsfile,action)

INPUT
- XLSFILE: name of the Excel file
- ACTION: 'close' (closes file if it is open) or '' (do nothing). Option 'close' only works with MS Excel.

OUTPUT
- ISOPEN:
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

Comments and Ratings (6)

Thanks a lot! Very useful function!

Eugenio

Good job, thanks

daniel

daniel (view profile)

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

Pieter

Pieter (view profile)

Mathieu

Nice job !

Roman

Roman (view profile)

Updates

1.1

Changed input and output, and screenshot

MATLAB Release
MATLAB 7.10 (R2010a)
Tags Add Tags

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video