sheetnames
Get sheet names from spreadsheet file
Description
Examples
Query Sheet Names from Spreadsheet File
Get the name of all worksheets from the spreadsheet file airlinesmall_subset.xlsx
.
sheets = sheetnames('airlinesmall_subset.xlsx')
sheets = 13x1 string
"1996"
"1997"
"1998"
"1999"
"2000"
"2001"
"2002"
"2003"
"2004"
"2005"
"2006"
"2007"
"2008"
Input Arguments
filename
— Name of file to read
character vector | string scalar
Name of the file to read, specified as a character vector or a string scalar.
Depending on the location of your file, filename
can take one of
these forms.
Location | Form | ||||||||
---|---|---|---|---|---|---|---|---|---|
Current folder or folder on the MATLAB® path | Name of the file. Example:
| ||||||||
Other local folder | Full or relative path to the file. Example:
Example:
| ||||||||
Remote Location | Full path to the file, specified as a uniform resource locator (URL) of the form:
Based on the remote location,
For more information, see Work with Remote Data. Example:
|
On Windows® systems with Microsoft® Excel® software, the
sheetnames
function supports:.xls
,.xlsm
,.xlsx
,.xltm
,.xltx
,.xlsb
, and.ods
.If your system does not have Excel for Windows, then
sheetnames
supports only:.xls
,.xlsx
,.xlsm
,.xltx
, and.xltm
files.
Data Types: char
| string
Version History
Introduced in R2019b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)