Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Used drawing colors in shapes....lost default colors for "Fill Col Lai704 Excel Discussion (Misc queries) 1 August 20th 08 04:45 AM
excel 2007 colors do not match excel 2003 colors. Tom's Travails' Excel Discussion (Misc queries) 0 July 17th 08 01:56 AM
How do I save pivotchart colors and shapes on data refresh? ReggieSLC Charts and Charting in Excel 0 April 16th 08 10:26 PM
Formatting shapes with excel 2007 Bucky Excel Discussion (Misc queries) 0 March 8th 07 08:49 PM
VBA code to count colors/shapes? Nimrod[_2_] Excel Programming 12 May 8th 05 05:14 AM


All times are GMT +1. The time now is 11:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"