+ Reply to Thread
Results 1 to 3 of 3

1004 - Application-defined or object-defined error - Copying chart from excel to word

  1. #1
    Registered User
    Join Date
    04-28-2004
    Posts
    49

    1004 - Application-defined or object-defined error - Copying chart from excel to word

    Hi, this forum has been incredibly helpful in the past, I just hope I can get some help now.

    I have a workbook that builds a word based report from data. The code below was working fine for years then I believe IT upgraded our version of Office to 2010 it appears to have brought about this failure.

    This particular portion of the word report contains a few tables, and approximately 6 or so charts. The problem occurs when pasting the "Chart 6" onto the second page in the Word doc. The crazy thing is right above the code in red below is the code that completes the same process for "Chart 8" which is fine.

    The only difference between the charts is Chart 6 is a bar graph, whereas Chart 8 is a line graph. I just don't know why it is now throwing the 1004 error. Any ideas?

    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,027

    Re: 1004 - Application-defined or object-defined error - Copying chart from excel to word

    It would be helpful to know exactly what line of code is raising this error.

    The code itself may be fine. This code is dependent on attributes of your document; for example, there must be a chart in your Excel sheet called "Chart 6" and there must be a bookmark in the Word document named "Chart2a". I can't confirm any of that by looking only at code. Can you attach both your Excel and Word file?

    It would also be helpful to see all the code, so I can see how you have things declared, particularly wdInfo. Not crucial, but helpful.

    I would step through the code and check the following:
    • After the first red line, what is theChart2.Name?
    • Does the Copy method succeed?
    • After setting wdInfo, what is wdInfo.Text? Is it what you expect?
    • If everything works up until here it seems unlikely that the Past is causing a problem.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    04-28-2004
    Posts
    49

    Re: 1004 - Application-defined or object-defined error - Copying chart from excel to word

    I will post more when i get back to the computer today, but it works when i step through the code, but fails with the 1004 error when i let it run as normal, this is why the code appears to be ok on the surface... It was working fine for months then just stop. I know IT is doing things constantly at work, but i find it strange that it could effect just this on chart of many...

+ 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. [SOLVED] application-defined/object-defined error 1004 when trying to read from or write to cells
    By florin_excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2012, 08:38 AM
  2. [SOLVED] run-time error '1004' application-defined or object-defined error - Excel 2007
    By kaurka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2012, 02:46 AM
  3. Replies: 2
    Last Post: 09-12-2012, 01:01 PM
  4. RE: Runtime error 1004- application defined or object defined erro
    By Novice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2006, 05:40 PM
  5. 1004 Application-defined or object-defined error using Border(X).linestyle
    By leeds55 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-19-2005, 12:14 PM

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