XL.IsInitialized
----------------

Checks if libXL library has been initialized.

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

MBS( "XL.IsInitialized" ) ### Parameters

none

### Result

Returns 1 or 0.

### Description

Checks if libXL library has been initialized.  
If value is 1, everything is okay.  
If value is zero, the library is not initialized and you need to call [XL.Initialize](XLInitialize.md) function.  
On a hosted database this function is better than using a global variable, as the variable can't see if initialization was made on server or client side.   
### Examples

Initialize when needed:

 #Initialize XL   
If \[MBS ( "XL.IsInitialized" ) ≠ 1\]  
 If \[Get ( SystemPlatform ) = -3\]  
 # iOS  
 Exit Script \[\]  
 Else If \[Get ( SystemPlatform ) = -2\]  
 # Windows  
 Set Variable \[$path ; Value: "libxl.dll"\]  
 Set Variable \[$key ; Value: "win-32213..."\]  
 Else  
 # Mac  
 Set Variable \[$path ; Value: "libxl.dylib"\]  
 Set Variable \[$key ; Value: "mac-32213..."\]  
 End If  
 Set Variable \[$r ; Value: MBS ( "[XL.Initialize](XLInitialize.md)"; $path ; "test"; $key )\]  
 If \[$r ≠ "OK"\]  
 Show Custom Dialog \[ "LibXL failed to initialize"; $r \]  
 End If  
End If  
Register LibXL for MBS Plugin

 If \[ MBS ("XL.IsInitialized") ≠ 1 \]  
 If \[ MBS ("IsMacOS") \]  
 Set Variable \[ $r ; Value: MBS ( "[XL.Initialize](XLInitialize.md)"; $path ; "xxx"; "mac-xxx" )\]  
 Else If \[ MBS ("IsWindows") \]  
 Set Variable \[ $r ; Value: MBS ( "[XL.Initialize](XLInitialize.md)"; $path ; "xxx"; "win-xxx" )\]  
 Else If \[ MBS ("IsLinux") \]  
 Set Variable \[ $r ; Value: MBS ( "[XL.Initialize](XLInitialize.md)"; $path ; "xxx"; "linux-xxx" )\]  
 Else If \[ MBS ("IsIOS") \]  
 Set Variable \[ $r ; Value: MBS ( "[XL.Initialize](XLInitialize.md)"; $path ; "xxx"; "ios-xxx" )\]  
 Else  
 Set Variable \[ $r ; Value: "new platform?" \]  
 End If  
 If \[$r ≠ "OK"\]  
 Show Custom Dialog \["Problem with LibXL Registration"; $r \]  
 End If  
End If  
### See also

- [IsWindows](IsWindows.md)
- [OCR.IsInitialized](OCRIsInitialized.md)
- [TAPI.IsInitialized](TAPIIsInitialized.md)
- [XL.Book.SaveToFile](XLBookSaveToFile.md)
- [XL.Initialize](XLInitialize.md)
- [XL.LoadBook](XLLoadBook.md)
- [XL.Sheet.AddDataValidation](XLSheetAddDataValidation.md)
- [XL.Sheet.CellType](XLSheetCellType.md)
- [XL.Sheet.RemoveRow](XLSheetRemoveRow.md)
- [XL.Uninitialize](XLUninitialize.md)

### Example Databases

- [XL/AutoFilter](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/AutoFilter.shtml#1ScriptAnchor_)
- [XL/Change Column Names](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Change%20Column%20Names.shtml#4ScriptAnchor_)
- [XL/Conditional Formatting](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Conditional%20Formatting.shtml#1ScriptAnchor_)
- [XL/Converter](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Converter.shtml#1ScriptAnchor_)
- [XL/Edit Sheet](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Edit%20Sheet.shtml#1ScriptAnchor_)
- [XL/Export records](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Export%20records.shtml#2ScriptAnchor_)
- [XL/Writing data](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Writing%20data.shtml#1ScriptAnchor_)
- [XL/XL Import and Export](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/XL%20Import%20and%20Export.shtml#2ScriptAnchor_)
- [XL/XL Test](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/XL%20Test.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin 16.1 News](https://www.mbsplugins.de/archive/2026-03-31/MBS_FileMaker_Plugin_161_News/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 13 - XL](https://www.mbsplugins.de/archive/2023-12-13/MBS_Plugin_Advent_calendar_13_/monkeybreadsoftware_blog_filemaker)
- [Tips and tricks with MBS](https://www.mbsplugins.de/archive/2023-08-10/Tips_and_tricks_with_MBS/monkeybreadsoftware_blog_filemaker)
- [Read And Write Excel Files With FileMaker](https://www.mbsplugins.de/archive/2022-08-17/Read_And_Write_Excel_Files_Wit/monkeybreadsoftware_blog_filemaker)
- [New column names in an Excel document](https://www.mbsplugins.de/archive/2019-05-14/New_column_names_in_an_Excel_d/monkeybreadsoftware_blog_filemaker)
- [How to use XL functions with MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2015-02-09/How_to_use_XL_functions_with_M/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.2pr6](https://www.mbsplugins.de/archive/2014-05-14/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 5/2022, Seite 21](https://filemaker-magazin.de/neuigkeit/4196-Appetithappen-FMM_202205)

This function is free to use.

Created 18th August 2014 , last changed 29th January 2023

  
[XL.Initialize](XLInitialize.md) - [XL.List](XLList.md)

[HTML Version](XLIsInitialized.shtml)