no effect when setting height of PlotArea with VBA

E

Enda

Hi all,
Has anyone experienced this problem. I am reducing the height of a chart PlotArea.
The following code has no effect on the .Height property of the PlotArea!

With ActiveChart
With .PlotArea
.Height = .Height - 2

Am I missing something? Is this a bug?

Regards,
Enda
 
J

Jon Peltier

Enda -

What version of Excel are you using. I was thinking at first that your
problem was beginner's (bad) luck, but while writing a sample macro I
had some funny things happen too.

- Jon
 
E

Enda

Hi Jon,
Sorry for my delay in replying.

I am using Excel 2000 9.0.6926 SP-3 on Windows 2000. It seems that the
sample code will reduce PlotArea.Height by an arbitrary amount or not
at all!
Have you any suggestions on a work-around that can exactly set
PlotArea Height and Width?

Regards,
Enda
 
J

Jon Peltier

Since reading your post, I found out that this is a known issue, but
there's no documentation available. I haven't been playing with Excel
2000 long enough to know how to get around this issue. As always, I have
some ideas to try, in my copious spare time.

- Jon
 
J

Jon Peltier

I meant to say, that's the version I'm using, with Win XP Home. The plot
area height likes to increase by 21 points every time I as it to
decrease; in fact, it seems to overshoot the value I command it to by
around 21 points, until it is too large to expand further. Perhaps you
could find your offset, and deduct that:

myOffset = -21
With ActiveChart
With .PlotArea
.Height = .Height - 2 + myOffset


- Jon
 
E

Enda

Hi Jon,
Unfortunately my difference (sometimes an overshoot and sometimes an
undershoot) is not constant. Even iterating with small changes in
PlotArea to approach the desired dimensions does not work.
Thanks for your time.

Enda
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top