ChartArea position in 2010 vs 2007

mikejvir

Board Regular
Joined
Jan 3, 2008
Messages
95
Hello,

I have a VBA macro that re-formats an Excel Chart (in a separate tab) for specific specific chart area that works in 2007.

Code:
    ActiveChart.ChartArea.Select
    With Selection
      .Top = 0
      .Left = 0
      .Width = 745  '735
      .Height = 530 '530
      .Border.LineStyle = xlNone
      .Interior.ColorIndex = xlNone
    End With

This does not work in Excel 2010. I get the error Run-time error '-2147024809 (80070057)': The specified value is out of range. It also does not matter what value I try to use. (By default Top = 0, Left =0, Width = 747.75, Height =531.75).

I can not move the chart area manually either. The workbook is not protected (as far as I can tell) and in the Format Chart Area it was Locked (but should not matter since the sheet is not protect) but I took that off also.

If I say PlotArea instead of ChartArea this will change the plot area position.

It's obvious I am missing something fundamental. Can anyone enlighten me. Thanks.


Sincerely,


___________________________________
Michael J. Virostko
 
Hello All,

I have to assume this problem does not seem real to anyone or they have not seen it. But it is and is causing me a massive headache. I took out the above code completely figuring it does not make a big difference. This worked for my test charts in both Excel 2010 and Excel 2007. I then started to run this on my data. This is working for Excel 2010, but in Excel 2007 after three or four charts the ChartArea be is not the full page and until I put the code back in the ChartArea the chart looks bad.

I already test for Excel 2003 (Though I could get rid this is since only my personal computer is running Excel 2003) so do I just extend this as a phantom error and program around it?

Thanks

Mike Virostko
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top