+ Reply to Thread
Results 1 to 8 of 8

Excel 2007 : Chart.PlotArea.Width does not work

  1. #1
    Forum Contributor Gabor's Avatar
    Join Date
    02-15-2004
    Location
    Székesfehérvár, Hungary
    MS-Off Ver
    xl2016
    Posts
    226

    Chart.PlotArea.Width does not work

    xl2007 does not perform the marked line in this code:

    Please Login or Register  to view this content.
    at another place also lays off the hammer:

    Please Login or Register  to view this content.
    Although it did with xl2003.
    Annoying.

    Any ideas?

    Thanks
    Regards,

    Gabor

    Protect trees.. maybe one day we need to climb back....

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Chart.PlotArea.Width does not work

    what is the value of Gwidth ?

    Does it raise an error ?

    Is there space in the chart to adjust the plotarea to the size required?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor Gabor's Avatar
    Join Date
    02-15-2004
    Location
    Székesfehérvár, Hungary
    MS-Off Ver
    xl2016
    Posts
    226

    Re: Chart.PlotArea.Width does not work

    The value of Gwidth is 451.

    No error.

    First the width of the chart is to be adjusted.
    Then the plot area width is to be matched with the chart size.

    This is a Gantt chart.
    There is a commandbutton on the chart, the main duty of the commandbutton is to toggle between hiding or making visible the range of the chart that has the input cells to the Gantt charts. And tis does not work now.

    Cheers

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Chart.PlotArea.Width does not work

    Does the chart area have enough room for the plotarea to be that wide?

    When setting the sizes an error will not be raised but at the same time the new value will not be applied. It will end up as width as the space that is available.

    Can you post example workbook?

  5. #5
    Forum Contributor Gabor's Avatar
    Join Date
    02-15-2004
    Location
    Székesfehérvár, Hungary
    MS-Off Ver
    xl2016
    Posts
    226

    Re: Chart.PlotArea.Width does not work

    The chartobject is supposed to be widened first, but also does not work.
    So I am trying to change the width of the graph first and after that the width of the plot area. Neither of them works.

    Please Login or Register  to view this content.
    Somehow the .Width command does not work in xl2007.
    Neither under .ChartObjects(), nor after .Chart.PlotArea.
    And it was perfect under xl2003.
    Very annoying.

    I try to post a workbook.

    How to see the failure mode:
    There is a commandbutton on the sheet with caption 'Date Table' . you hit this in xl2003 the Gantt chart will be bigger, hides the data entry range, in xl2007 just moves to left, remains same size. Hit the button again will switch back to normal.

    Thanks
    Attached Files Attached Files

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Chart.PlotArea.Width does not work

    Maybe it has something to do with the fact that the chart object has the Aspect Lock on. Therefore changing either the width or height will impact on the other.

    In the AlignTheGraphs routine change,

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor Gabor's Avatar
    Join Date
    02-15-2004
    Location
    Székesfehérvár, Hungary
    MS-Off Ver
    xl2016
    Posts
    226

    Re: Chart.PlotArea.Width does not work

    Beautiful.

    Question: how come it works with xl2003 and does not with xl2007 ?

    Question #2 : if I un-rem the following lines, the macros will run onto error. Why is that?

    Please Login or Register  to view this content.
    Thanks

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Chart.PlotArea.Width does not work

    When you say it ran in xl2003 is that this file or a previous version before you updated it to xl2007?


    I uncomment all occurances of the protect and unprotect and the Data Table button worked without error.

+ 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