Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel 2007 and FormatConditions code
Message
From
24/02/2009 02:23:17
 
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:
01383678
Views:
41
>> Unfortunately it didn't work for Excel 2007, I still don't see the green highlight. It works OK for Excel 2003.

I only have Excel 2007, this is my entire code and when I type "TOTAL" in any cell in Column A I get the highlight (checked down to cell A60487 then got bored :-) )
#INCLUDE excel9.h

loExcel=CREATEOBJECT("Excel.Application")
loExcel.Workbooks.ADD()
loPage=loExcel.Workbooks(1).Worksheets(1)
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
loExcel.Visible=.T.

RETURN
Can you seperate out more of you code and I can try and run it?

Gary.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform