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

XL.Sheet.SetHeader

Sets the header text of the sheet when printed.

Component Version macOS Windows Linux Server iOS SDK
XL 3.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "XL.Sheet.SetHeader"; bookRef; sheetIndex; Text { ; Margin } )   More

Parameters

Parameter Description Example Flags
bookRef The reference to the workbook. Please use XL.LoadBook to load a file. $ref
sheetIndex The index of the sheet. This number ranges from 0 to XL.Book.SheetCount-1. 0
Text The new header text. "test"
Margin The margin to use. 0.5 Optional

Result

Returns OK or error message.

Description

Sets the header text of the sheet when printed.
The text appears at the top of every page when printed. The length of the text must be less than or equal to 255. The header text can contain special commands, for example a placeholder for the page number, current date or text formatting attributes. Special commands are represented by single letter with a leading ampersand ("&"). Margin is specified in inches.

CodeDescription
&Lspecifies the beginning of the left section
&Pspecifies the current page number
&Nspecifies the total number of pages
&\d{1,3}specifies the text font size, where font size is measured in points, for example: &9 or &36
&Sspecifies whether the strikethrough text style is on or off
&Xspecifies whether the superscript text style is on or off
&Yspecifies whether the subscript text style is on or off
&Cspecifies the beginning of the center section
&Dspecifies a date
&Tspecifies a time
&Gspecifies a picture
&Uspecifies whether the single underline text style is on or off
&Especifies whether the double underline text style is on or off
&Rspecifies the beginning of the right section
&Zspecifies a workbook file path
&Fspecifies a workbook file name
&Aspecifies a sheet name
&"fontname"specifies the text font, for example: &"Comic Sans MS"
&Bspecifies whether the bold text style is on or off
&Ispecifies whether the italic text style is on or off
&&specifies an ampersand character (&)

Examples

Set sheet name:

MBS( "XL.Sheet.SetHeader"; $book; 0; "My Report 2019" )

See also

This function checks for a license.

Created 18th August 2014, last changed 16th May 2019


XL.Sheet.SetHCenter - XL.Sheet.SetHidden