+ Reply to Thread
Results 1 to 9 of 9

Method 'Width' of object 'PlotArea' failed?

  1. #1
    Registered User
    Join Date
    08-26-2010
    Location
    Halden, Norway
    MS-Off Ver
    Excel 2007
    Posts
    27

    Method 'Width' of object 'PlotArea' failed?

    Hi all,

    I use the below code to create a graph, but it fails to position the PlotArea.

    Method of 'Width' object 'PlotArea' failed
    Method of 'Left' object 'PlotArea' failed

    Why?

    (The code is a mess at the moment...)

    Please Login or Register  to view this content.
    Regards,
    Jørn
    Last edited by jmadsen; 09-24-2010 at 11:24 AM.

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

    Re: Method 'Width' of object 'PlotArea' failed?

    Looks like another chart timing/refresh issue.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-26-2010
    Location
    Halden, Norway
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Method 'Width' of object 'PlotArea' failed?

    Thanks for the answer Andy, but it did not help.

    The same Error.

    Where should I put the code? Right before where the PlotArea object is called?

    Regards,
    Jørn

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

    Re: Method 'Width' of object 'PlotArea' failed?

    Yes as the example I posted which included 2 new lines and 2 existing lines of code.

    Do you get the error if you use F8 to step through the code line by line?

    Can you post workbook to illustrate the error.

  5. #5
    Registered User
    Join Date
    08-26-2010
    Location
    Halden, Norway
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Method 'Width' of object 'PlotArea' failed?

    Hi again Andy,

    Your code work if I only create one Graph. I am creating 5 Graphs with the Macro and
    it manage to create the first graph, but when it returns to create the second one, it fails.

    I will try to run the ScreenUpdating in a For Loop 4 or 5 times before starting to create graph number 2 and so on...

    Regards,
    Jørn

  6. #6
    Registered User
    Join Date
    08-26-2010
    Location
    Halden, Norway
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Method 'Width' of object 'PlotArea' failed?

    Hi,

    Problem solved. This is a solution that works.

    Please Login or Register  to view this content.
    Regards,
    Jørn

  7. #7
    Registered User
    Join Date
    09-10-2012
    Location
    23 Minutes into the Future
    MS-Off Ver
    2010, 2011
    Posts
    2

    Re: Method 'Width' of object 'PlotArea' failed?

    Turning screenupdating off and on again doesn't work.

  8. #8
    Registered User
    Join Date
    09-10-2012
    Location
    23 Minutes into the Future
    MS-Off Ver
    2010, 2011
    Posts
    2

    Re: Method 'Width' of object 'PlotArea' failed?

    using the "on error resume next" doesn't solve the problem, because if an error gets thrown, the graph dimension doesn't get changed.

    This is not a solution.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Method 'Width' of object 'PlotArea' failed?

    scbritton apparently it did, according to the OP.

    Plus, this thread is almost 6 years old, I doubt it is still being followed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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