I have a worksheet with multiple types of charts (bar, line, pie). I have created VBA code that adjusts the size of the plot area when the back end data is refreshed. This is necessary because for some reason the charts plot area size will not stay after the data is refreshed, or after the workbook is closed, and re-opened. My code for the bar, and line charts works fine. The pie charts do not want to work with my code though.
Oddly enough, if I change the chart size manually in the worksheet, then run my code, the size stays, but running the code beforehand does nothing. Here is an example of my code:
The code seems to work fine in 2003. Right now I am using 2007 in compatibility mode, this is where I am having the problem.
Any help is greatly appreciated!
For a = 17 To 20
ActiveSheet.ChartObjects("Chart" & a).Activate
.PlotArea.Height = 208
.PlotArea.Top = 62
.PlotArea.Width = 208
.PlotArea.Left = 121