xlsxInfo
Get information about an Excel file.
Syntax
info = xlsxInfo(filename [, sheet_identifier])
Arguments
- filename
A string specifying the path to the Excel file to analyze.
- sheet_identifier (optional)
A string (sheet name) or positive integer (sheet index, 1-based) identifying a specific sheet.
If omitted: Returns information about the entire workbook (all sheets)
If provided: Returns detailed information about the specified sheet only
Description
Read metadata and information from an Excel (.xlsx) file without loading the actual data.
This function provides comprehensive information about the file structure, metadata, and properties.
Usage modes:
Without sheet_identifier: Returns workbook-level information including all sheet names, file metadata, and document properties.
With sheet_identifier: Returns detailed information about a specific sheet, including dimensions and sheet-specific metadata.
The file must exist and be a valid Excel (.xlsx) format.
Return values
This function returns a structure containing comprehensive information about the Excel file.
When called without sheet_identifier (workbook information):
filename: A string containing the path to the analyzed file.
total_sheets: A double indicating the number of sheets in the file.
sheet_names: A string array containing the names of all sheets in the file.
creator: A string containing the name of the creator of the file.
last_modified_by: A string containing the name of the last person who modified the file.
created_date: A string containing the creation date and time.
modified_date: A string containing the last modified date and time.
title: A string containing the document title (may be empty).
subject: A string containing the document subject (may be empty).
description: A string containing the document description (may be empty).
file_size: A double indicating the size of the file in bytes.
When called with sheet_identifier (specific sheet information):
sheet_name: A string containing the name of the sheet.
sheet_index: A double indicating the sheet index in the workbook.
max_row: A double indicating the maximum row number containing data.
max_col: A double indicating the maximum column number containing data.
cell_count: A double indicating the total number of cells containing data.
Examples
// Create example file data = [1 2 3; 4 5 6; 7 8 9]; test_file = TMPDIR + "/test_info.xlsx"; xlsxWrite(data, test_file, "title", "Test File", "subject", "Example", .. "description", "Test file for xlsxInfo"); // Get information about the entire workbook info = xlsxInfo(test_file) // Get information about a specific sheet by name sheet_info = xlsxInfo(test_file, "Sheet1")
See also
History
| Version | Description |
| 2026.1.0 | Introduction in Scilab. |
| Report an issue | ||
| << xls_read | Tableur | xlsxRead >> |