Be the first to rate this file! 42 Downloads (last 30 days) File Size: 2.22 KB File ID: #41878
image thumbnail

Check if XLS file is open and close it

by

 

22 May 2013 (Updated )

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

| Watch this File

File Information
Description

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

Acknowledgements

This file inspired Run Ms Excel Macro, Delete Worksheets In Excel File, and Protect Or Unprotect Worksheets In Excel File.

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
03 Jun 2013

Changed input and output, and screenshot

Contact us