Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel 2007 and FormatConditions code
Message
From
23/02/2009 15:57:13
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01383370
Message ID:
01383586
Views:
56
This message has been marked as a message which has helped to the initial question of the thread.
>>Thanks a lot for your response. I put TOTAL in the first column at the very bottom. The mentioned code works fine in Excel 2003, >>but does nothing in Excel 2007.

>>How exactly do you suggest me to adjust it?

Naomi,
I've not used xlLastCell before, but as far as I can see in 2007 at least it is only return a selection to the last cell that has a value assigned, therefore in an empty column it only selects and assigns the FormatCondition to cell A1.

If you change your selection line as below it seems to work fine.
*!*loExcel.RANGE([A1], loExcel.SELECTION.SpecialCells(xlLastCell)).SELECT
loExcel.Columns("A:A").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
Regards

Gary.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform