Difficulty with RoundCorners property

T

tkpmep

I'm trying to round the corners of a graph using VBA, but consistently
get a Run-time error '438' Object doesn't support this property or
method. I have no difficulty doing it in Excel and recording a macro,
but seem unable to do it directly from VBA - even cutting and pasting
the macro recorder's code into VBA does me no good. Any assistance
would be greatly appreciated.

In the code listed below, the shadow and legend work like a charm, but
RoundedCorners does not work in either of the two ways shown.


Sincerely

Thomas Philips

Range(Selection, Selection.End(xlDown)).Name = "ChartData1"
Set ch = Sheet3.ChartObjects.Add(Left:=l1, Top:=t1, Width:=w1,
Height:=h1)
With ch.Chart
.ChartType = xlColumnClustered
.SetSourceData Source:=Range("ChartData1")
.ChartArea.Interior.ColorIndex = 2
.PlotArea.Interior.ColorIndex = 2
.ChartArea.Shadow = True

.RoundedCorners = True

.ChartArea.RoundedCorners = True

.Legend.Position = xlTop
End With
 
P

Peter T

RoundedCorners is a property of the chartobject

With ch.Chart
..Parent.RoundedCorners = True

or
ch.RoundedCorners = True

Regards,
Peter T
 

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