Skip to main content

SetErrorTitle

Sets the title of the data-validation error dialog box.

Syntax

expression.SetErrorTitle(ErrorTitle);

expression - A variable that represents a ApiValidation class.

Parameters

NameRequired/OptionalData typeDefaultDescription
ErrorTitleRequiredstringThe error dialog title.

Returns

This method doesn't return any data.

Example

This example sets the error message title.

// How to set the validation error title.

// Set the error title.

let worksheet = Api.GetActiveSheet();
let range = worksheet.GetRange("A1");
let validation = range.GetValidation();
validation.Add("xlValidateWholeNumber", "xlValidAlertStop", "xlGreater", 10);
validation.SetErrorTitle("Invalid Input");
validation.SetShowError(true);
worksheet.GetRange("B1").SetValue("Error title has been set");