+ Reply to Thread
Results 1 to 7 of 7

Pasting (charts) error from 2003 to 2007 (and 2010)

  1. #1
    Registered User
    Join Date
    12-29-2010
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2003
    Posts
    14

    Pasting (charts) error from 2003 to 2007 (and 2010)

    Hi,


    I have a macro that I wrote in 2003 but gives me an error (Run-time error '1004' Paste method fail) when I try to run it in in 2007 or 2010. I'm really not sure why. I'm basically creating a bunch of charts that comes from a varying amount of data. I have also attached a workbook so you can see what I am doing, The part where the error is thrown is wsCharts.Paste. Please any help is greatly appreciated.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by tmd2; 01-08-2011 at 07:52 PM. Reason: To include sample workbook

  2. #2
    Registered User
    Join Date
    12-29-2010
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Pasting (charts) error from 2003 to 2007 (and 2010)

    Sorry I made a mistake with the error I am receiving. The error says "method 'paste' of object '_worksheet' failed" Please any help at all is greatly appreciated.

    Thanks

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

    Re: Pasting (charts) error from 2003 to 2007 (and 2010)

    I could not get the code to fail.

    You might try referencing the 1st chartobject rather than the complete collection.

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

  4. #4
    Registered User
    Join Date
    12-29-2010
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Pasting (charts) error from 2003 to 2007 (and 2010)

    Wow Andy that worked great! I can't thank you enough! I'm not sure why it worked in 2007 for you and not me. I tried it on several machines. If you don't mind(and have the time) could you tell me what exactly the difference is? It seems like it should work either. Is the way I originally had it saving the stored cut code for the collection of charts, and now just for the 1st Chart object? Then I suppose 2007 can't paste a collection for some reason? Or am I completely off? Thanks so much again I can't tell how much I appreciate it.

    Tom

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

    Re: Pasting (charts) error from 2003 to 2007 (and 2010)

    I don't know the exact reason but the object model for charting and shapes was rewritten for xl2007. So things not working as they did in xl2003 is just to be expected and worked around, if possible.

  6. #6
    Registered User
    Join Date
    12-29-2010
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Pasting (charts) error from 2003 to 2007 (and 2010)

    Ok makes sense...Thanks a lot again for your help.

  7. #7
    Registered User
    Join Date
    08-04-2007
    Posts
    2

    Re: Pasting (charts) error from 2003 to 2007 (and 2010)

    Hey,

    Great work!

    I have a question, is it possible to view one of your charts` data as a column and the others as a line chart overstacked together?

    For example, stock mkt charts with financial volumes beneath.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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