>>** Made the Totals row in bold and Green highlight
>> loExcel.RANGE([A1], loExcel.SELECTION.SpecialCells(xlLastCell)).SELECT
>> loExcel.SELECTION.FormatConditions.DELETE
>> loExcel.SELECTION.FormatConditions.ADD(xlExpression,, '=UPPER(Left($A1,5))="TOTAL"')
>> WITH loExcel.SELECTION.FormatConditions(1)
>> .FONT.Bold = .T.
>> .Interior.ColorIndex = 4
>> ENDWITH
>>I found that it doesn't work in Excel 2007, e.g. the Totals are not highlighted with green color.
>>Do you know how to make this code work in this version?
Naomi,
I can't see anything wrong with your sample code, however the formating would only show IF the value of cell A1 was "TOTAL".
if you add this line to your code:
loExcel.Range("A1").Value="TOTAL"
Then the formatting shows.
FYI: Excel 2007 still recognises the .ColorIndex values, but also now uses a .color property which gives you the full colour range.
Gary.