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

XL.Sheet.CellType

Queries type of cell.

Component Version macOS Windows Linux Server iOS SDK
XL 3.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "XL.Sheet.CellType"; BookRef; SheetIndex; Row; Column )   More

Parameters

Parameter Description Example
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
Row The row for the cell. First row has index 0. $row
Column The column for the cell. First column has index 0. $column

Result

Returns type or error message.

Description

Queries type of cell.
Types can be empty, number, text, boolean, blank or error.

Examples

Try the function:

# Initialize the XL functions if not already initialized
If [MBS("XL.IsInitialized") ≠ 1]
        Set Variable [$libPath; Value: "/Library/FileMaker Server/libxl.dylib"]
        Set Variable [$initResult; Value: MBS("XL.Initialize"; $libPath)]
End If

# Create a new Excel workbook
Set Variable [$book; Value: MBS("XL.NewBook"; 0)]

# Add a sheet named "TestSheet"
Set Variable [$sheet; Value: MBS("XL.Book.AddSheet"; $book; "TestSheet")]

# Write a number to cell A1
Set Variable [$r; Value: MBS("XL.Sheet.CellWriteNumber"; $book; $sheet; 0; 0; 123)]

# Write a text to cell B1
Set Variable [$r; Value: MBS("XL.Sheet.CellWriteText"; $book; $sheet; 0; 1; "Hello World")]

# Write a boolean to cell C1
Set Variable [$r; Value: MBS("XL.Sheet.CellWriteBoolean"; $book; $sheet; 0; 2; True)]

# Write a formula to cell D1
Set Variable [$r; Value: MBS("XL.Sheet.CellWriteFormula"; $book; $sheet; 0; 3; "=SUM(A1)")]

# Query the type of each cell
Set Variable [$typeA1; Value: MBS("XL.Sheet.CellType"; $book; $sheet; 0; 0)]
Set Variable [$typeB1; Value: MBS("XL.Sheet.CellType"; $book; $sheet; 0; 1)]
Set Variable [$typeC1; Value: MBS("XL.Sheet.CellType"; $book; $sheet; 0; 2)]
Set Variable [$typeD1; Value: MBS("XL.Sheet.CellType"; $book; $sheet; 0; 3)]

# Display the results
Show Custom Dialog ["Cell Types"; "A1: " & $typeA1 & "¶B1: " & $typeB1 & "¶C1: " & $typeC1 & "¶D1: " & $typeD1]

# Save the workbook to a container field
Set Field [YourTable::ExcelFile; MBS("XL.Book.Save"; $book; "TestWorkbook.xls")]

# Release the workbook to free memory
Set Variable [$r; Value: MBS("XL.Book.Release"; $book)]

See also

This function checks for a license.

Created 18th August 2014, last changed 12nd June 2025


XL.Sheet.CellReadValues - XL.Sheet.CellWriteBlank