Adjusting the Microsoft Graph colour palette from within Word VBA

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
 
J

Jonathan West

Hi Mark

It's a bug in MSGraph. It's been there through several versions of Office,
never fixed by Microsoft, probably never will be. You simply can't change
the palette using VBA.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top