chart

  • Thread starter Thread starter Yves Janssens
  • Start date Start date
Y

Yves Janssens

All,

With VBA I'm making a chart sheet.
This chart sheet is than viewed by the user. I have protected this sheet, so
he can make no changes.
I have also set some settings for the graph options:
Application.ShowChartTipNames = False
Application.ShowChartTipValues = False

Now I notice that you can still select the different parts of the graph.
Is it possible to switch this off?

I also would like to add a button on this chart sheet. I tried this with:
ActiveSheet.Buttons.Add(869189.25, 125211.75, 395520.75,
289965).Select
ActiveChart.Shapes("Button 1").Select
Selection.Characters.Text = "Print"

But when I ran the code I don't see any button. What do I wrong?


Thanks a lot in advance,

Yves
 
Yves -

To prevent selection of the chart elements, use this:

activechart.ProtectSelection=True


Why can't you see the button?

?activesheet.chartarea.width
675
?activesheet.chartarea.height
459

You are asking for a huge button (395520.75 points wide, 289965 points
high) far below (869189.25 points) and to the right (125211.75 points)
of the chart, which is only 675x459 points in size (6-3/8 by 9-3/8
inches). This gave me a button where I could see it:

ActiveChart.Buttons.Add(10, 50, 100, 25).Select
Selection.Characters.Text = "Print"

You can't add a button if the chart is protected, so unprotect the
chart, add the button, then protect the chart.

- Jon
 
Back
Top