You can set the value only if the ColorScaleCriterion.Type property for the conditional format is set to one of the following constants:
ConditionValueNumber, ConditionValuePercent, ConditionValuePercentile, or ConditionValueFormula.
If the type of threshold is a formula, you can set the formula as a String. The formula must return a single number.