| Contents | Index |
status = xlsfinfo(filename)
[status,sheets]
= xlsfinfo(filename)
[status,sheets,format]
= xlsfinfo(filename)
status = xlsfinfo(filename) returns a nonempty string when the specified file is in an Excel format that xlsread can read (for example, 'Microsoft Excel Spreadsheet'). Otherwise, status is an empty string, ''.
[status,sheets] = xlsfinfo(filename) returns a cell array of strings containing the names of each spreadsheet in the file.
[status,sheets,format] = xlsfinfo(filename) returns a string containing the format description that Excel returns for the file. On systems without Excel for Windows, format is an empty string, ''.
filename |
String enclosed in single quotation marks that specifies the name of the file. |
status |
If the file is in an Excel format that xlsread can read, status is a nonempty string. Otherwise, status is an empty string, ''. | ||||||||
sheets |
If the file is in an Excel format that xlsread can read, sheets is a 1-by-n cell array of strings, where n is the number of worksheets. Each cell contains the name of a worksheet. If MATLAB cannot read a particular worksheet, the corresponding cell contains an error message. If the file is not in a readable Excel format, sheets is a string containing an error message. | ||||||||
format |
On Windows systems with Excel software, format is a string that contains the description that Excel returns for the file. For example:
On all other systems, format is an empty string, ''. |
Consider a hypothetical file with worksheets named Sheet1, Income, and Expenses. Get information about the file:
[typ, desc, fmt] = xlsfinfo('myaccount.xlsx')This code returns:
typ =
Microsoft Excel Spreadsheet
desc =
'Sheet1' 'Income' 'Expenses'
fmt =
xlOpenXMLWorkbook
Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |