in reply to Real conditional formatting in Spreadsheet::WriteExcel?

Excel::Template might be useful here ... It's a wrapper around Spreadsheet::WriteExcel that provides a similar interface as HTML::Template.
<workbook> <worksheet name="Foo"> <if name="my_val" op=">=" value="4"> <format bgcolor="red"> <cell><var name="my_val" /></cell> </format> </if> <if name="my_val" op="<" value="4"> <cell><var name="my_val" /></cell> </if> </worksheet> </workbook>
See the documentation for more info.

Replies are listed 'Best First'.
Re^2: Real conditional formatting in Spreadsheet::WriteExcel?
by StarNamer (Novice) on Mar 31, 2005 at 20:43 UTC
    As far as I can see, this can only generate what WriteExcel can already do.

    The point is that the conditional format(s) I'd like to put in are referencing formulae and could be tweaked by the end-user, i.e. they adjust a value of a cell somewhere, Excel recalculates various formulae and another cell's background color changes to show the effect.

    If it was simply a case of testing a value and setting the background while writing the worksheet I could do that directly with WriteExcel.

      As far as I can see, this can only generate what WriteExcel can already do.

      Seeing as it's a wrapper around S::WE, I'd be very surprised if it could do something that S::WE couldn't do. However, it can help redefine the problemspace in a different way. But, that's not your issue here.

      Now, if you wanted to do a conditional within the formula, there isn't a Perl module that will help ... right now. Maybe this is a space for you to write one? Have a way to help generate the string that can be passed to S::WE based on some templating?