FormatCondition.Type Property in Excel 2003 vs Excel 2007

M

Mike Cowie

Hi,

I noticed a change in the Type property as read in VBA for some conditional
formats in Excel 2007. If I have a conditional format in cell $A$1 that is
based on a formula like "=$B$5="Sales"", here is what I see when reading the
Type proprety between the 2 most recent versions of Excel:

Excel 2003:
MyCF.Type = 2 (xlFormatConditionType.xlExpression)

Excel 2007:
MyCF.Type = 1 (xlFormatConditionType.xlCellValue)

I see this result opening the exact same workbook in both versions of Excel.
This is causing a bit of a problem because I have VBA code that looks to the
Operator property when the Type is Cell Value. But, when the condition is
actually based on an expression the Operator property is undefined. I can
certainly add in some error handling, but why has this changed in the first
place? I'm using Excel 2007 SP1 (12.0.6323.5000) and Excel 2003 SP 2
(11.8120.8122).

Regards,
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top