XL.Book.GetRGBMode
------------------

Returns whether the RGB mode is active.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [XL](component_XL.md) | [3.5](newinversion35.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "XL.Book.GetRGBMode"; BookRef ) 

**MBS**( **"XL.Book.GetRGBMode";** /\* Returns whether the RGB mode is active. \*/  
**$BookRef**) /\* The reference number for the workbook.e.g. $ref \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| BookRef | The reference number for the workbook. | $ref |

### Result

Returns 0 for index mode or 1 for RGB mode or error.

### Description

Returns whether the RGB mode is active.  
### Examples

Sets the fore color to red:

 If \[ MBS ( "XL.Book.GetRGBMode"; $book ) = 0 \]  
 Set Variable \[ $r ; Value: MBS ( "[XL.Format.SetPatternForegroundColor](XLFormatSetPatternForegroundColor.md)"; $book ; $format ; 10) \]   
Else  
 Set Variable \[ $c ; Value: MBS ( "[XL.Color.Pack](XLColorPack.md)"; $book ; 255; 0; 0) \]  
 Set Variable \[ $r ; Value: MBS ( "[XL.Format.SetPatternForegroundColor](XLFormatSetPatternForegroundColor.md)"; $book ; $format ; $c ) \]   
End If  
Set Variable \[ $r ; Value: MBS ( "[XL.Format.SetFillPattern](XLFormatSetFillPattern.md)"; $book ; $format ; 1 ) \]  
### See also

- [XL.Book.GetCalcMode](XLBookGetCalcMode.md)
- [XL.Book.SetCalcMode](XLBookSetCalcMode.md)
- [XL.Book.SetRGBMode](XLBookSetRGBMode.md)
- [XL.Color.Pack](XLColorPack.md)
- [XL.Format.SetFillPattern](XLFormatSetFillPattern.md)
- [XL.Format.SetPatternBackgroundColor](XLFormatSetPatternBackgroundColor.md)
- [XL.Format.SetPatternForegroundColor](XLFormatSetPatternForegroundColor.md)

This function checks for a license.

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

  
[XL.Book.GetPictureType](XLBookGetPictureType.md) - [XL.Book.GetRefR1C1](XLBookGetRefR1C1.md)

[HTML Version](XLBookGetRGBMode.shtml)