M
Marky Mark
I'm having trouble setting the colour palette of a Microsoft Graph chart from
within VBA. I can create the chart and adjust all the properties and
everything, but I want to modify the palette in the chart so the bottom two
rows of the palette (default colours for fills and lines) are my own custom
colours.
I've got the macro, and there aren't any runtime errors, but the palette
just doesn't change! I've followed help as much as I can. Has anybody come
across this, or have any suggestions. It's driving me crazy!
Here's the code I'm using to add the chart and set the colour on the palette:
Set oShape = Selection.InlineShapes.AddOLEObject
(ClassType:="MSGraph.Chart.8", FileName:="", LinkToFile:=False,
DisplayAsIcon:=False)
Set oGraph = oShape.OLEFormat.Object
With oGraph
.Colors(17) = RGB(255, 0, 0)
End With
within VBA. I can create the chart and adjust all the properties and
everything, but I want to modify the palette in the chart so the bottom two
rows of the palette (default colours for fills and lines) are my own custom
colours.
I've got the macro, and there aren't any runtime errors, but the palette
just doesn't change! I've followed help as much as I can. Has anybody come
across this, or have any suggestions. It's driving me crazy!
Here's the code I'm using to add the chart and set the colour on the palette:
Set oShape = Selection.InlineShapes.AddOLEObject
(ClassType:="MSGraph.Chart.8", FileName:="", LinkToFile:=False,
DisplayAsIcon:=False)
Set oGraph = oShape.OLEFormat.Object
With oGraph
.Colors(17) = RGB(255, 0, 0)
End With