Problem to modify the size of PlotArea

X

Xavier

Hello,

I am trying to modify a chart so that it prints in a 20cm x 17,5cm frame. I
do understand that this is governed by the plotarea.insideheight and
plotarea.insidewidth properties. I also do understant that these properties
are read-only. So far my code is the following:

With ActiveChart
.SizeWithWindow = False
.PageSetup.ChartSize = xlScreenSize
.PlotArea.Width = 567
.PlotArea.Height = 496
Do While .PlotArea.InsideWidth < 567
.PlotArea.Width = .PlotArea.Width + 1
Loop

Do While .PlotArea.InsideHeight < 496
.PlotArea.Height = .PlotArea.Height + 1
Loop

End With


The problem I am facing is the following: the first do...loop works fine and
if I print the result, I do get exactly 20cm. However, the second do...loop
loops indefinitely, in debugging mode, I see that the initial value of
..PlotArea is 451 (and not 496) and during the loop, it never gets increased
???

Does anyone know what am I doing wrong ?

Thanks,

Xavier
 
X

Xavier

Problem solved:

The margins defined in my page setup were limiting the hight that could be
used for the chart. Reducing the margins solved the issue.

Xavier
 

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