Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

XL.Book.SheetName

Queries the name of a sheet.

Component Version macOS Windows Linux Server iOS SDK
XL 16.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "XL.Book.SheetName"; BookRef; SheetIndex )   More

Parameters

Parameter Description Example
BookRef The reference number for the workbook. $ref
SheetIndex The index of the sheet. This number ranges from 0 to XL.Book.SheetCount-1. 0

Result

Returns OK or error.

Description

Queries the name of a sheet.

Examples

Query sheet names:

Set Variable [ $names ; Value: "" ]
Set Variable [ $count ; Value: MBS( "XL.Book.SheetCount"; $bookRef) ]
Set Variable [ $index ; Value: 0 ]
Loop [ Flush: Defer ]
    Set Variable [ $names ; Value: $names & MBS( "XL.Book.SheetName"; $bookRef; $index ) & ¶ ]
    #
    Set Variable [ $index ; Value: $index + 1 ]
    Exit Loop If [ $index >= $count ]
End Loop
Set Field [ XL::Text ; $names ]

See also

Example Databases

Blog Entries

Created 25th January 2026, last changed 25th January 2026


XL.Book.SheetIndexForName - XL.Book.Sheets