Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel 2007 and FormatConditions code
Message
De
23/02/2009 02:11:32
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01383370
Message ID:
01383415
Vues:
41
>>** 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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform