-
Yeah, it's a little strange. Most chart properties set fine with either method, but PlotArea seems to have issues. I'm having quite a few similar problems now that I'm tidying up my code (in Excel 2000) by replacing objects with references to the objects. Some of these new issues are just lack of updating (such as Chart.CopyAsPicture giving an outdated image) and can be fixed by inserting a Application.CalculateFull. Others, like the PlotArea just don't set correctly.
A related question: Is there a direct way of knowing Chart.ChartTitle.Height and Chart.Axes(xlCategory).AxisTitle.Height? I'm thinking that there isn't. It's a problem when changing font size in the titles and then optimizing the plot size. Right now, my 'fix' is to:
1. Set all the chart text objects to .AutoScaleFont = False
2. Set the ChartObject.Width and .Height to something tiny
3. Set the ChartObject.Width and .Height back to the correct size, so that Excel automatically reformats the whole thing.
It works, but it would be nice to know the actual height values.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules