+ Reply to Thread
Results 1 to 2 of 2

Problem to modify the size of PlotArea

  1. #1
    Xavier
    Guest

    Problem to modify the size of PlotArea

    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




  2. #2
    Xavier
    Guest

    Re: Problem to modify the size of PlotArea

    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

    "Xavier" <[email protected]> wrote in message
    news:%[email protected]...
    > 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
    >
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1