跳到主要内容

SetIgnoreBlank

Sets whether blank values are permitted by the range data validation.

Syntax

expression.SetIgnoreBlank(IgnoreBlank);

expression - A variable that represents a ApiValidation class.

Parameters

NameRequired/OptionalData typeDefaultDescription
IgnoreBlankRequiredbooleanSpecifies whether blank values are permitted.

Returns

This method doesn't return any data.

Example

This example sets whether blank values are permitted.

// How to allow or disallow blank values in validation.

// Set the IgnoreBlank setting.

let worksheet = Api.GetActiveSheet();
let range = worksheet.GetRange("A1");
let validation = range.GetValidation();
validation.Add("xlValidateWholeNumber", "xlValidAlertStop", "xlGreater", 10);
validation.SetIgnoreBlank(false);
worksheet.GetRange("B1").SetValue("Blank values are not allowed");