Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default RGB fill colours

Any ideas why the chart fill won't accept RGB colour values? Despite MSDN
saying a FillFormat should....
http://msdn2.microsoft.com/en-us/lib...ffice.11).aspx

An example:

--------------------------------------------
bRGB = false
With oBook.ActiveChart.PlotArea.Fill

if (bRGB) then
' This doesn't work
.ForeColor.RGB = RGB(128, 0, 0)
.BackColor.RGB = RGB(170, 170, 170)
else
' This works
.ForeColor.SchemeColor = 15
.BackColor.SchemeColor = 16
end if

.TwoColorGradient msoGradientHorizontal, 1
End With
--------------------------------------------

Setting bRGB to true results in: Wrong number of arguments or invalid
property assignment: 'ForeColor.RGB'

This is being called from an external VBScript, not within Excel, if that
makes a difference.

Am I misreading how this should work? Suggestions or workarounds welcome.
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default RGB fill colours

Hi,

The MSDN example is for Shapes not charts.
The RGB property for a chart element is readonly.

The help says:

RGB property as it applies to the ChartColorFormat object.
Returns the red-green-blue value of the specified color. Read-only Long.

Charts, unlike shapes, are restricted to the usual 56 colour palette of
excel.

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"DuncanL" wrote in message
...
Any ideas why the chart fill won't accept RGB colour values? Despite MSDN
saying a FillFormat should....
http://msdn2.microsoft.com/en-us/lib...ffice.11).aspx

An example:

--------------------------------------------
bRGB = false
With oBook.ActiveChart.PlotArea.Fill

if (bRGB) then
' This doesn't work
.ForeColor.RGB = RGB(128, 0, 0)
.BackColor.RGB = RGB(170, 170, 170)
else
' This works
.ForeColor.SchemeColor = 15
.BackColor.SchemeColor = 16
end if

.TwoColorGradient msoGradientHorizontal, 1
End With
--------------------------------------------

Setting bRGB to true results in: Wrong number of arguments or invalid
property assignment: 'ForeColor.RGB'

This is being called from an external VBScript, not within Excel, if
that
makes a difference.

Am I misreading how this should work? Suggestions or workarounds welcome.
Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default RGB fill colours


The MSDN example is for Shapes not charts.
The RGB property for a chart element is readonly.


Ah... bother!

Thanks for the help.


Duncan
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
TWO DIFFERENT FILL COLOURs ON MENU BAR Kirstoff Excel Discussion (Misc queries) 2 August 17th 07 04:30 PM
Cell Fill colours stuart Excel Discussion (Misc queries) 2 March 8th 07 05:04 PM
fill colours Khyber Setting up and Configuration of Excel 8 August 22nd 06 01:32 AM
Fill colours Theo Excel Worksheet Functions 1 January 13th 06 04:16 AM
Automatically insert fill colours? suzi Excel Worksheet Functions 1 November 17th 04 02:40 PM


All times are GMT +1. The time now is 11:48 PM.

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"