Platforms to show: All Mac Windows Linux Cross-Platform

Back to XLFormatMBS class.

XLFormatMBS.AlignH as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The horizontal alignment.

See AlignH* constants.
(Read and Write property)

Some examples using this property:

XLFormatMBS.AlignV as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The vertical alignment.

See AlignV* constants.
(Read and Write property)

Some examples using this property:

XLFormatMBS.Book as XLBookMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The object owning this format object.

As a format is only valid with the owning book, we keep a back reference here.
(Read only property)

XLFormatMBS.BorderBottom as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The bottom border style.

See BorderStyle* constants.
(Read and Write property)

XLFormatMBS.BorderBottomColor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The color of the bottom border.

If book is in RGB mode, you need to use UnpackColor to get red, green and blue color components or color value from the returned number. If book is not in RGB mode, you receive a color number (see XLFontMBS color constants).
If you set value and book is in RGB mode you can use PackColor function to get a numeric value for a color or color components. If the book is not in RGB mode, you can use color constants in XLFontMBS classes.
(Read and Write property)

XLFormatMBS.BorderDiagonal as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The diagonal border.

see BorderDiagonal* constants.
(Read and Write property)

XLFormatMBS.BorderDiagonalColor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The color of the diagonal border.

If book is in RGB mode, you need to use UnpackColor to get red, green and blue color components or color value from the returned number. If book is not in RGB mode, you receive a color number (see XLFontMBS color constants).
If you set value and book is in RGB mode you can use PackColor function to get a numeric value for a color or color components. If the book is not in RGB mode, you can use color constants in XLFontMBS classes.
(Read and Write property)

XLFormatMBS.BorderDiagonalStyle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The diagonal border style.

See BorderDiagonal* constants.
(Read and Write property)

XLFormatMBS.BorderLeft as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The left border style.

See BorderStyle* constants.
(Read and Write property)

Some examples using this property:

XLFormatMBS.BorderLeftColor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The color of the left border.

If book is in RGB mode, you need to use UnpackColor to get red, green and blue color components or color value from the returned number. If book is not in RGB mode, you receive a color number (see XLFontMBS color constants).
If you set value and book is in RGB mode you can use PackColor function to get a numeric value for a color or color components. If the book is not in RGB mode, you can use color constants in XLFontMBS classes.
(Read and Write property)

XLFormatMBS.BorderRight as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The right border style.

See BorderStyle* constants.
(Read and Write property)

Some examples using this property:

XLFormatMBS.BorderRightColor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The color of the right border.

If book is in RGB mode, you need to use UnpackColor to get red, green and blue color components or color value from the returned number. If book is not in RGB mode, you receive a color number (see XLFontMBS color constants).If you set value and book is in RGB mode you can use PackColor function to get a numeric value for a color or color components. If the book is not in RGB mode, you can use color constants in XLFontMBS classes.
(Read and Write property)

XLFormatMBS.BorderTop as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The top border style.

See BorderStyle* constants.
(Read and Write property)

Some examples using this property:

XLFormatMBS.BorderTopColor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The color of the top border.

If book is in RGB mode, you need to use UnpackColor to get red, green and blue color components or color value from the returned number. If book is not in RGB mode, you receive a color number (see XLFontMBS color constants).
If you set value and book is in RGB mode you can use PackColor function to get a numeric value for a color or color components. If the book is not in RGB mode, you can use color constants in XLFontMBS classes.
(Read and Write property)

XLFormatMBS.FillPattern as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The fill pattern.

See fill pattern constants.
(Read and Write property)

XLFormatMBS.Font as XLFontMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The font for the format.
Example
// your book
dim book as XLBookMBS

// add font
dim StrikeOutFont as XLFontMBS = book.addFont()
StrikeOutFont.StrikeOut = true

// add format
dim StrikeOutFormat as XLFormatMBS = book.addFormat
StrikeOutFormat.font = StrikeOutFont

// write on a cell in first sheet
sheet = book.Sheet(0)
call sheet.WriteString(1, 1, "Sales Receipt", StrikeOutFormat)

To create a new font use XLBookMBS.addFont(). Returns false if error occurs. Get error info with XLBookMBS.ErrorMessage property.
(Read and Write property)

XLFormatMBS.Handle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The internal object reference.

(Read only property)

XLFormatMBS.Hidden as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the hidden protection property is set to true.

(Read and Write property)

XLFormatMBS.Indent as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The text indentation level.

Must be less than or equal to 15.
(Read and Write property)

XLFormatMBS.Locked as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the locked protection property is set to true.

Needs to be used together with XLSheetMBS.Protect property and XLSheetMBS.SetProtectEx method to prevent editing in locked cells.
(Read and Write property)

XLFormatMBS.NumFormat as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The number format identifier.

The identifier must be a valid built-in number format identifier or the identifier of a custom number format. To create a custom format use XLBookMBS.addCustomNumFormat(). Or use one of the NumFormat* constants.
(Read and Write property)

Some examples using this property:

XLFormatMBS.PatternBackgroundColor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The background color of the fill pattern.
Example
// define a format for red fill
Dim redBackgroundFormat As XLFormatMBS = book.AddFormat
Dim c As Color = &cFF0000
// will give back numeric value of color for RGB mode or color index
Dim n As Integer = book.PackColor(c)
// we set forecolor of the pattern to fill background!
redBackgroundFormat.PatternForegroundColor = n
redBackgroundFormat.PatternBackgroundColor = n
redBackgroundFormat.FillPattern = XLFormatMBS.FillPatternSolid

Dim row As Integer = 5 // 6th row
Dim col As Integer = 1 // Column B
Dim value As Double = 123

Call sheet.WriteNumber row, col, value, redBackgroundFormat

If book is in RGB mode, you need to use UnpackColor to get red, green and blue color components or color value from the returned number. If book is not in RGB mode, you receive a color number (see XLFontMBS color constants).
If you set value and book is in RGB mode you can use PackColor function to get a numeric value for a color or color components. If the book is not in RGB mode, you can use color constants in XLFontMBS classes.
(Read and Write property)

XLFormatMBS.PatternForegroundColor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The foreground color of the fill pattern.
Example
// define a format for red fill
Dim redBackgroundFormat As XLFormatMBS = book.AddFormat
Dim c As Color = &cFF0000
// will give back numeric value of color for RGB mode or color index
Dim n As Integer = book.PackColor(c)
// we set forecolor of the pattern to fill background!
redBackgroundFormat.PatternForegroundColor = n
redBackgroundFormat.PatternBackgroundColor = n
redBackgroundFormat.FillPattern = XLFormatMBS.FillPatternSolid

Dim row As Integer = 5 // 6th row
Dim col As Integer = 1 // Column B
Dim value As Double = 123

Call sheet.WriteNumber row, col, value, redBackgroundFormat

If book is in RGB mode, you need to use UnpackColor to get red, green and blue color components or color value from the returned number. If book is not in RGB mode, you receive a color number (see XLFontMBS color constants).
If you set value and book is in RGB mode you can use PackColor function to get a numeric value for a color or color components. If the book is not in RGB mode, you can use color constants in XLFontMBS classes.
(Read and Write property)

Some examples using this property:

XLFormatMBS.Rotation as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the text rotation.

Must be a value from the following table:
ValueMeaning
0 - 90Text rotated counterclockwise 0 to 90 degrees
91 - 180Text rotated clockwise 1 to 90 degrees
255Vertical text
(Read only property)

XLFormatMBS.ShrinkToFit as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the cell is shrink-to-fit.

(Read and Write property)

XLFormatMBS.Wrap as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the cell text is wrapped.

(Read and Write property)

The items on this page are in the following plugins: MBS XL Plugin.


The biggest plugin in space...