+ Reply to Thread
Results 1 to 6 of 6

Check to see if Chart Object Exist

  1. #1
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Check to see if Chart Object Exist

    Hello,

    I have a command button by the name "cmdTurn" that updates a chart when clicked. I want to create message box that checks the chart to see if a particular legend entry exists (e.g., "Profit"). If it does exist, it tells tells the user that this legend entry already exists therefore exit the sub. I wrote the following code, but I know its wrong:

    My command button name is: cmdTurn
    My chart object name is: chartTurn

    Please Login or Register  to view this content.
    I created a post already in Mr. Excel and here is the link: http://www.mrexcel.com/forum/microso...ect-exist.html

    I just want to expand the network seeing that I have found no solution and to avoid the cross posting issue.

    - BC

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,014

    Re: Check to see if Chart Object Exist

    I think the best you can do is see what series already exist - but reading the legend key is not possible, IIRC.

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Re: Check to see if Chart Object Exist

    I get an error with method property "SeriesCollection," apparently Access does not like this property.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,014

    Re: Check to see if Chart Object Exist

    I think Access does - are you sure chartTurn is correctly declared as a chart object? You might actually have meant

    Me.ChartObject("chartTurn")

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Re: Check to see if Chart Object Exist

    That's it, thanks for your help!
    Last edited by boldcode; 03-24-2016 at 03:04 PM. Reason: SOLVED

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Check to see if Chart Object Exist

    If posting code please use code tags, see here.

+ 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] Check First IF Sheet Is Exist With The Name Of Cell K7 If exist Then run the code
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-18-2015, 10:08 AM
  2. moving chart object and keep object ability for chart events?
    By tdrose01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2014, 06:43 AM
  3. Check before if Chart object exist
    By arora in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-08-2013, 01:26 PM
  4. How to check if a object exist on a HTML Document
    By matius_88 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-15-2013, 02:19 PM
  5. Check if Column Exist
    By izet99 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-21-2009, 02:43 PM
  6. How to, check if a picture object exist
    By Kevin McCartney in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-24-2006, 03:55 PM
  7. How to test if an object exist really
    By Jean-Pierre Bidon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2006, 09:30 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