+ Reply to Thread
Results 1 to 12 of 12

Move a named chart

  1. #1
    Registered User
    Join Date
    10-30-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    Move a named chart

    Hi, I have generated 3 charts which all go onto one sheet. I want to position them in specific places. This is my code:
    Please Login or Register  to view this content.

    It all works until it comes to positioning the charts. Error says "The item with the specified name wasn't found" so I tried using the name "N_Chart1" instead of "Dissolved Oxygen" but it didn't work.

    Any ideas?
    THanks
    Katie xx

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Move a named chart

    Also: http://www.mrexcel.com/forum/excel-q...med-chart.html

  3. #3
    Registered User
    Join Date
    10-30-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Move a named chart

    yeah i posted that... why have you linked it?

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

    Re: Move a named chart

    Please Login or Register  to view this content.
    The object reference is destroyed when the location is changed so you need to reset it.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Move a named chart

    Rules, and you agreed to them when you joined...

    8. Don't cross-post without a link. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post. Expect cross-posts without a link to be closed.

    For info MrExcel has the same rule, as does every other board like this.

  6. #6
    Registered User
    Join Date
    10-30-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Move a named chart

    Well I clicked "forum rules" at the bottom right of the page and there was no real information, so I went ahead.
    I will remember that.

  7. #7
    Registered User
    Join Date
    10-30-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Move a named chart

    Quote Originally Posted by Andy Pope View Post
    Please Login or Register  to view this content.
    The object reference is destroyed when the location is changed so you need to reset it.
    Thanks so much!
    My only question is.. why can't I use the names (eg "temperature")? What can I do with these names? If nothing I may as well delete 'N_Chart1.Name' lines...
    xxx

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

    Re: Move a named chart

    Because the sheet name is not retained. The object is given a new name, infact they all probably have the same name, Chart 1.

    You might want to name the newly created chartobjects for future reference.

  9. #9
    Registered User
    Join Date
    10-30-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Move a named chart

    Quote Originally Posted by Andy Pope View Post
    Because the sheet name is not retained. The object is given a new name, infact they all probably have the same name, Chart 1.

    You might want to name the newly created chartobjects for future reference.
    Ok thank you Andy.
    From what you just said, I expected this code to work (it doesn't )
    Please Login or Register  to view this content.

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

    Re: Move a named chart

    Why would you expect that to work, I said the name was lost and your code does not reapply it.

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-30-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Move a named chart

    ok i misread what you said. so what you said was in agreement with what i said : i may as well remove those earlier .name lines if they're irrelevant. thanks

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

    Re: Move a named chart

    Yes the earlier naming is not required as it will be lost.
    You may however want to name them once they are on the worksheet in case you need to reference them at a later stage.

+ 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