Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Colors Shapes vs Cells (Excel 2007)
There seems to be two different color index schemes in Excel, on for
the cells and one for the shapes. So one cannot write code like MyCell.interior.colorIndex = MyShape.Fill.ForeColor.SchemaColor Is there any clean way to convert one to the other? I need the same color schemes in different places. (MyDrawingObject.interior.colorIndex was compatible with cells.) Thanks, Anthony |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Colors Shapes vs Cells (Excel 2007)
I,m not sure I understand why ColorIndex = 3 for SchemaColor would be
different than ColorIndex = 3 for Cell.Interior? "Anthony Berglas" wrote: There seems to be two different color index schemes in Excel, on for the cells and one for the shapes. So one cannot write code like MyCell.interior.colorIndex = MyShape.Fill.ForeColor.SchemaColor Is there any clean way to convert one to the other? I need the same color schemes in different places. (MyDrawingObject.interior.colorIndex was compatible with cells.) Thanks, Anthony |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Colors Shapes vs Cells (Excel 2007)
Add or subtract 7, eg
schemecolor 10 is colorindex 3 (the first 8 starting from zero apply color constants, eg vbRed) note Charts also use a schemecolor, but these are equivalent to colorindex's in the range 1-56, with system colours beyond Regards, Peter T "Anthony Berglas" wrote in message ups.com... There seems to be two different color index schemes in Excel, on for the cells and one for the shapes. So one cannot write code like MyCell.interior.colorIndex = MyShape.Fill.ForeColor.SchemaColor Is there any clean way to convert one to the other? I need the same color schemes in different places. (MyDrawingObject.interior.colorIndex was compatible with cells.) Thanks, Anthony |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Colors Shapes vs Cells (Excel 2007)
Also see:
http://experts.about.com/q/Excel-105...atting-set.htm "Anthony Berglas" wrote: There seems to be two different color index schemes in Excel, on for the cells and one for the shapes. So one cannot write code like MyCell.interior.colorIndex = MyShape.Fill.ForeColor.SchemaColor Is there any clean way to convert one to the other? I need the same color schemes in different places. (MyDrawingObject.interior.colorIndex was compatible with cells.) Thanks, Anthony |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Colors Shapes vs Cells (Excel 2007)
Thanks for pointing this out. shape -- cell subtract 7 for colors,
and subtract 8 for patterns. Next problem:- MyShape.Fill.ForeColor.SchemeColor works in XL 2003, but not 2007. The last is a bit worrying. I would have thought that Excel would have a large suite of regression tests, and that even the quick tests would test that every property of every object was basically there. By Beta 2 I'm expecting almost production ready, certainly for the old features. But maybe not. Does anyone know whether Microsoft actually reads the SAS reports? I fill out some but suspect that I am wasting my time. They probably just statistically sample them for keywords from time to time. Regards, Anthony Peter T wrote: Add or subtract 7, eg schemecolor 10 is colorindex 3 (the first 8 starting from zero apply color constants, eg vbRed) note Charts also use a schemecolor, but these are equivalent to colorindex's in the range 1-56, with system colours beyond Regards, Peter T "Anthony Berglas" wrote in message ups.com... There seems to be two different color index schemes in Excel, on for the cells and one for the shapes. So one cannot write code like MyCell.interior.colorIndex = MyShape.Fill.ForeColor.SchemaColor Is there any clean way to convert one to the other? I need the same color schemes in different places. (MyDrawingObject.interior.colorIndex was compatible with cells.) Thanks, Anthony |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Colors Shapes vs Cells (Excel 2007)
and subtract 8 for patterns.
I don't follow, there's no correlation between cell & shape patterns. Regards, Peter T "Anthony Berglas" wrote in message oups.com... Thanks for pointing this out. shape -- cell subtract 7 for colors, and subtract 8 for patterns. Next problem:- MyShape.Fill.ForeColor.SchemeColor works in XL 2003, but not 2007. The last is a bit worrying. I would have thought that Excel would have a large suite of regression tests, and that even the quick tests would test that every property of every object was basically there. By Beta 2 I'm expecting almost production ready, certainly for the old features. But maybe not. Does anyone know whether Microsoft actually reads the SAS reports? I fill out some but suspect that I am wasting my time. They probably just statistically sample them for keywords from time to time. Regards, Anthony Peter T wrote: Add or subtract 7, eg schemecolor 10 is colorindex 3 (the first 8 starting from zero apply color constants, eg vbRed) note Charts also use a schemecolor, but these are equivalent to colorindex's in the range 1-56, with system colours beyond Regards, Peter T "Anthony Berglas" wrote in message ups.com... There seems to be two different color index schemes in Excel, on for the cells and one for the shapes. So one cannot write code like MyCell.interior.colorIndex = MyShape.Fill.ForeColor.SchemaColor Is there any clean way to convert one to the other? I need the same color schemes in different places. (MyDrawingObject.interior.colorIndex was compatible with cells.) Thanks, Anthony |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Colors Shapes vs Cells (Excel 2007)
I haven't checked all of them but it works for the ones I am interested
in (vert & horizontal stripes etc.) (Old Style means Cell formats.) ---------- Old Style --------- Pattern SchemaColor 1 fsProtoSchemaShade 15 8 2 fsProtoRightShade 11 8 3 fsProtoBelowShade 12 8 4 fsProtoSkippedShade 9 8 ---------- Shape ForeColor --------- 1 fsProtoSchemaShade 23 15 2 fsProtoRightShade 19 15 3 fsProtoBelowShade 20 15 4 fsProtoSkippedShade 17 15 Peter T wrote: and subtract 8 for patterns. I don't follow, there's no correlation between cell & shape patterns. Regards, Peter T "Anthony Berglas" wrote in message oups.com... Thanks for pointing this out. shape -- cell subtract 7 for colors, and subtract 8 for patterns. Next problem:- MyShape.Fill.ForeColor.SchemeColor works in XL 2003, but not 2007. The last is a bit worrying. I would have thought that Excel would have a large suite of regression tests, and that even the quick tests would test that every property of every object was basically there. By Beta 2 I'm expecting almost production ready, certainly for the old features. But maybe not. Does anyone know whether Microsoft actually reads the SAS reports? I fill out some but suspect that I am wasting my time. They probably just statistically sample them for keywords from time to time. Regards, Anthony Peter T wrote: Add or subtract 7, eg schemecolor 10 is colorindex 3 (the first 8 starting from zero apply color constants, eg vbRed) note Charts also use a schemecolor, but these are equivalent to colorindex's in the range 1-56, with system colours beyond Regards, Peter T "Anthony Berglas" wrote in message ups.com... There seems to be two different color index schemes in Excel, on for the cells and one for the shapes. So one cannot write code like MyCell.interior.colorIndex = MyShape.Fill.ForeColor.SchemaColor Is there any clean way to convert one to the other? I need the same color schemes in different places. (MyDrawingObject.interior.colorIndex was compatible with cells.) Thanks, Anthony |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Colors Shapes vs Cells (Excel 2007)
There are 17 cell patterns & 48 shape patterns (excl. solid, none, mixed).
Indeed your +8 conversion seems to apply to the following - xlPatternChecker:=9 msoPatternSmallCheckerBoard:=17 xlPatternLightHorizontal:=11 msoPatternLightHorizontal:=19 xlPatternLightVertical:=12 msoPatternLightVertical:=20 xlPatternLightDown:=13 msoPatternLightDownwardDiagonal:=21 xlPatternLightUp:=14 msoPatternLightUpwardDiagonal:=22 xlPatternGrid:=15 msoPatternSmallGrid:=23 These patterns also appear similar - xlPatternGray25:=-4124 msoPattern25Percent:=4 xlPatternGray50:=-4125 msoPattern50Percent:=7 xlPatternHorizontal:=-4128 msoPatternDarkHorizontal:=13 xlPatternVertical:=-4166 msoPatternDarkVertical:=14 xlPatternDown:=-4121 msoPatternDarkDownwardDiagonal:=15 xlPatternUp:=-4162 msoPatternDarkUpwardDiagonal:=16 The other 5 cell patterns do not appear to directly match any of the other shape patterns Regards, Peter T PS msoPatternHorizontalBrick is 'empty' in my system "Anthony Berglas" wrote in message oups.com... I haven't checked all of them but it works for the ones I am interested in (vert & horizontal stripes etc.) (Old Style means Cell formats.) ---------- Old Style --------- Pattern SchemaColor 1 fsProtoSchemaShade 15 8 2 fsProtoRightShade 11 8 3 fsProtoBelowShade 12 8 4 fsProtoSkippedShade 9 8 ---------- Shape ForeColor --------- 1 fsProtoSchemaShade 23 15 2 fsProtoRightShade 19 15 3 fsProtoBelowShade 20 15 4 fsProtoSkippedShade 17 15 Peter T wrote: and subtract 8 for patterns. I don't follow, there's no correlation between cell & shape patterns. Regards, Peter T "Anthony Berglas" wrote in message oups.com... Thanks for pointing this out. shape -- cell subtract 7 for colors, and subtract 8 for patterns. Next problem:- MyShape.Fill.ForeColor.SchemeColor works in XL 2003, but not 2007. The last is a bit worrying. I would have thought that Excel would have a large suite of regression tests, and that even the quick tests would test that every property of every object was basically there. By Beta 2 I'm expecting almost production ready, certainly for the old features. But maybe not. Does anyone know whether Microsoft actually reads the SAS reports? I fill out some but suspect that I am wasting my time. They probably just statistically sample them for keywords from time to time. Regards, Anthony Peter T wrote: Add or subtract 7, eg schemecolor 10 is colorindex 3 (the first 8 starting from zero apply color constants, eg vbRed) note Charts also use a schemecolor, but these are equivalent to colorindex's in the range 1-56, with system colours beyond Regards, Peter T "Anthony Berglas" wrote in message ups.com... There seems to be two different color index schemes in Excel, on for the cells and one for the shapes. So one cannot write code like MyCell.interior.colorIndex = MyShape.Fill.ForeColor.SchemaColor Is there any clean way to convert one to the other? I need the same color schemes in different places. (MyDrawingObject.interior.colorIndex was compatible with cells.) Thanks, Anthony |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Colors Shapes vs Cells (Excel 2007)
Hi Anthony,
I gave this one a try in the most current builds, and it works well for me: ?ActiveSheet.Shapes(1).Fill.ForeColor.SchemeColor (returned 49 in my case - that was with a default blue rectangle object) Cheers, Dan Excel Team Note: We've only got a couple weeks to get bugs filed and fixed, so if I've requested additional info via email, it'd be great if you can get that to us ASAP. Please include any necessary sample files, as well as detailed repro steps so that we can try to reproduce the problem on our side. Also - if you're emailing me directly (definitely the most efficient at this point) you'll want to fixup my email address to remove everything after danbatt and before the @. "Anthony Berglas" wrote in message oups.com... Thanks for pointing this out. shape -- cell subtract 7 for colors, and subtract 8 for patterns. Next problem:- MyShape.Fill.ForeColor.SchemeColor works in XL 2003, but not 2007. The last is a bit worrying. I would have thought that Excel would have a large suite of regression tests, and that even the quick tests would test that every property of every object was basically there. By Beta 2 I'm expecting almost production ready, certainly for the old features. But maybe not. Does anyone know whether Microsoft actually reads the SAS reports? I fill out some but suspect that I am wasting my time. They probably just statistically sample them for keywords from time to time. Regards, Anthony Peter T wrote: Add or subtract 7, eg schemecolor 10 is colorindex 3 (the first 8 starting from zero apply color constants, eg vbRed) note Charts also use a schemecolor, but these are equivalent to colorindex's in the range 1-56, with system colours beyond Regards, Peter T "Anthony Berglas" wrote in message ups.com... There seems to be two different color index schemes in Excel, on for the cells and one for the shapes. So one cannot write code like MyCell.interior.colorIndex = MyShape.Fill.ForeColor.SchemaColor Is there any clean way to convert one to the other? I need the same color schemes in different places. (MyDrawingObject.interior.colorIndex was compatible with cells.) Thanks, Anthony |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Used drawing colors in shapes....lost default colors for "Fill Col | Excel Discussion (Misc queries) | |||
excel 2007 colors do not match excel 2003 colors. | Excel Discussion (Misc queries) | |||
How do I save pivotchart colors and shapes on data refresh? | Charts and Charting in Excel | |||
Formatting shapes with excel 2007 | Excel Discussion (Misc queries) | |||
VBA code to count colors/shapes? | Excel Programming |