in reply to Re: Win32::OLE Excel Conditional Formatting error
in thread Win32::OLE Excel Conditional Formatting error

A4 & A9 should not be red because of Conditional Formatting. It is not apply right now. I was trying to follow macro code.
  • Comment on Re^2: Win32::OLE Excel Conditional Formatting error

Replies are listed 'Best First'.
Re^3: Win32::OLE Excel Conditional Formatting error
by Danny (Chaplain) on Feb 29, 2024 at 20:23 UTC
    It looks like you need to use numeric values for Type and Operator in FormatConditions->Add. For example
    $rangeFormat->FormatConditions->Add({Type=>1, Operator=>4, Formula1=>" +=TRUE"}); $rangeFormat->FormatConditions(1)->Font->{Color} = -16776961;
    makes cells in the first column red except A4 and A9. Here are the codes for Type and Operator.
      Awesome, thank you!