Protecting Embedded Chart

K

Kevin

How do I completely lock down a chart embedded in a worksheet (not a chart
sheet) in VBA to prevent changed through the UI? I have tried:

Worksheet("MySheet").ChartObjects("MyChart").Chart.Protect
Worksheet("MySheet").ChartObjects("MyChart").ProtectChartObject = True
Worksheet("MySheet").ChartObjects("MyChart").Enabled = False
Worksheet("MySheet").ChartObjects("MyChart").Locked = True

I, of course, protected the worksheet itself also:

Sheets("MySheet").Protect Password:="SecretWord", DrawingObjects:=True,
Contents:=True, Scenarios:=True

None of these steps seem to prevent me making changes to the format of the
data series and legend. How do I lock down all of these items?

Thanks,

Kevin
 
A

Andy Smith

How about:

Worksheet("MySheet").ChartObjects("MyChart").Chart.Protect
DrawingObjects:=True, Contents:=True
 

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