+ Reply to Thread
Results 1 to 10 of 10

ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'

  1. #1
    Forum Contributor
    Join Date
    08-17-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    158

    ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'

    Hello!

    I have some code below that used to work and now all of a sudden it doesn't.
    The code is failing at ActiveSheet.Shapes.AddChart.Select
    I have never had an issue with the code not running through the entire procedure. Is there a work around for where the code is failing?

    Thank you!

    Please Login or Register  to view this content.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'

    I don't know why it fails but selecting is not required
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor
    Join Date
    08-17-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    158

    Re: ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'

    Hey JP,

    I tried your code, and it still fails at the first line ActiveSheet.Shapes.AddChart.Chart

    Any more thoughts?

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'

    did you protect the sheet? or share the workbook?

  5. #5
    Forum Contributor
    Join Date
    08-17-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    158

    Re: ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'

    Hey JP,

    Sheet is not protected nor has the workbook been shared.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'

    do you have more than one sheet selected?

  7. #7
    Forum Contributor
    Join Date
    08-17-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    158

    Re: ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'

    No, only one sheet is activated...

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'

    can you post a workbook?

  9. #9
    Forum Contributor
    Join Date
    08-17-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    158

    Re: ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'

    Including this clause works:

    Please Login or Register  to view this content.

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'

    that's not the same thing-it gets a reference to an existing chart rather than creating a new one. also the
    Please Login or Register  to view this content.
    is totally unnecessary (you ought never to need that!)

+ 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