[]
Generates the conditional format from the specified JSON string.
Use this method to restore the settings of a unique-values or duplicate-values conditional formatting rule from its JSON representation, such as a string returned by ToJson().
void FromJson(string json)
Sub FromJson(json As String)
| Type | Name | Description |
|---|---|---|
| string | json | The JSON string that represents a unique-values or duplicate-values |
worksheet.Range["A1:A5"].Value = new object[,] {
{100}, {100}, {200}, {300}, {300}
};
string json = "{\"ranges\":[{\"row\":0,\"col\":1,\"rowCount\":5,\"colCount\":1}],\"priority\":1,\"ruleType\":7}";
IUniqueValues targetRule = worksheet.Range["B1:B5"].FormatConditions.AddUniqueValues();
targetRule.FromJson(json);
| Type | Condition |
|---|---|
| InvalidOperationException | if the JSON string does not represent a unique-values |