Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
TWO DIFFERENT FILL COLOURs ON MENU BAR | Excel Discussion (Misc queries) | |||
Cell Fill colours | Excel Discussion (Misc queries) | |||
fill colours | Setting up and Configuration of Excel | |||
Fill colours | Excel Worksheet Functions | |||
Automatically insert fill colours? | Excel Worksheet Functions |