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


Sets an active sheet index in this workbook.

Component Version macOS Windows Linux Server iOS SDK
XL 3.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "XL.Book.SetActiveSheet"; bookRef; sheetIndex )   More


Parameter Description Example
bookRef The reference to the workbook. Please use XL.LoadBook to load a file. $ref
sheetIndex The index of the sheet to activate. This number ranges from 0 to XL.Book.SheetCount-1. 0


Returns OK or error.


Sets an active sheet index in this workbook.


Create a sheet and make it active:

Set Variable [ $sheet ; Value: MBS( "XL.Book.AddSheet"; $book; "Sales Receipt") ]
Set Variable [ $r ; Value: MBS( "XL.Book.SetActiveSheet"; $book; $sheet) ]

See also

This function checks for a license.

Created 18th August 2014, last changed 27th August 2023

XL.Book.SaveToFile - XL.Book.SetCalcMode