Chart resizing during macro run

  • Thread starter Thread starter Mike Green
  • Start date Start date
M

Mike Green

I have a VBA macro that updates a chart with a new data
range every 2 minutes, and then copies the chart to a Word
document for access via html/web displaying.
Over time, the actual chart gets smaller and smaller in
height (everything is scaled down to adjust) in the chart
area.
This happened with a Win98 Excel version, and still does
with a new installation of Win XP Pro/Excel 2002.

Is there anything I can do to stop this automatic resizing?

Thanks.
 
You could set the chart height during the macro:

Sheets("Sheet1").ChartObjects("Chart 1").Height = 250
 
I don't think this properly addressed the original question. I am
experiencing this problem too. It is not the OVERALL size of the chart that
gets scaled, just the pie or bar elements INSIDE the chart. The bounding box
of the chart remains the same height and width but the graphical elements
get smaller and smaller within the box.

I am experiencing this and there seems to be no way to lock it down, in
spite of having checked all of what seem to be the appropriate boxes
connected with controlling this.

Bill
 
Bill -

You just need to dive a bit deeper into the object model to find other
things to set. The stuff inside a chart is resized by changing the Plot
Area:

With Sheets("Sheet1").ChartObjects("Chart 1").Chart.PlotArea
.Top = 5
.Height = 200
.Left = 11
.Width = 315
End With

I don't know why things don't stay the size you set them. I haven't had
the problem that I can recall, but I've read many complaints about it.

- Jon
 
Back
Top