+ Reply to Thread
Results 1 to 7 of 7

Runtime Error '1004' when Copying Charts

  1. #1
    Registered User
    Join Date
    03-14-2014
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2010
    Posts
    11

    Runtime Error '1004' when Copying Charts

    Guys,

    I have a code that will automatically make a powerpoint presentation from several charts in my excel file. I get a runtime error when running the code on a few of the lines where the charts are copied. I hit debug, go to the actual chart in excel click on it, then go back to code and run and it works till the next time the Copy code comes up. So now I have to hit debug like 5 times then physically click the Chart the code errors out on, then continue running the code. If I immediately run the code again after I have went through and clicked the errored out charts, it works perfectly. IE once I have clicked them once I can run the code again and again without the error. Once I close the workbook and reopen does the Runtime error reoccur.


    I figure it is a syntax error but not sure why clicking on the chart makes it work???
    Any help is greatly appreciated.

    Here is the specific code it errors out on
    Please Login or Register  to view this content.
    Here is the entire code
    Please Login or Register  to view this content.

  2. #2
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Runtime Error '1004' when Copying Charts

    Hi,

    Are there multiple sheets in your workbooks, If Yes, check whether at the time of copy, sheets is activated or not.

    If not, use the following code:

    Please Login or Register  to view this content.

    Note: Paste this line of code after this line "Begin copy and paste of Charts to specific slides"

    Regards,
    Paresh J
    Click on "* Add Reputation" as a way to say thanks

  3. #3
    Registered User
    Join Date
    03-14-2014
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Runtime Error '1004' when Copying Charts

    Yes probably 10 sheets in the workbook all with specific names.

    I have tried adding the code you supplied to activate each sheet where the chart exists but still get the runtime error.


    Is there a way to activate the named ChartObject ?

  4. #4
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Runtime Error '1004' when Copying Charts

    Hi,

    Yes, You can activate the chart objects as well. With little modification in the above code.

    Please Login or Register  to view this content.

    Regards,
    Paresh J

  5. #5
    Registered User
    Join Date
    03-14-2014
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Runtime Error '1004' when Copying Charts

    Yes,
    I added a chart activate line before each and it appears to be working.


    Thank you for the assistance.

  6. #6
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Runtime Error '1004' when Copying Charts

    Hi,

    If you think you got your solution then please mark this thread as SOLVED and click * Add Reputation as way to say thanks....


    Regards,
    Paresh J

  7. #7
    Registered User
    Join Date
    11-02-2020
    Location
    Belgium
    MS-Off Ver
    Office 13
    Posts
    1

    Re: Runtime Error '1004' when Copying Charts

    Had the same problem copying charts form one worksheet to another
    Seems to work fine now
    THX!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Runtime error 1004 when copying & pasting data to another sheet
    By luneke1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2014, 06:04 PM
  2. Runtime 1004 Error when copying
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-03-2013, 09:51 AM
  3. Runtime Error 1004 while copying dinamic ranges
    By mallok in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-29-2013, 09:37 AM
  4. [SOLVED] Runtime Error 1004 when Copying worksheets from multiple workbooks into current workbook
    By dharris42 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2013, 11:56 AM
  5. Runtime error 1004 when copying and pasting a filtered collumn excel 2010
    By Shedacq in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2012, 06:35 AM

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