in reply to Win32::OLE Excel Conditional Formatting error

I just installed Win32::OLE and changed line 56 to
$rangeFormat->Font->{Color} = -16776961;
and it made the font in the first column red, if that is what you were trying to do.

Replies are listed 'Best First'.
Re^2: Win32::OLE Excel Conditional Formatting error
by slick.user (Acolyte) on Feb 29, 2024 at 19:04 UTC
    A4 & A9 should not be red because of Conditional Formatting. It is not apply right now. I was trying to follow macro code.
      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!
Re^2: Win32::OLE Excel Conditional Formatting error
by Anonymous Monk on Feb 29, 2024 at 19:01 UTC
    I was trying to use Conditional Formatting, if it is not "TRUE" to highlight all red.