+ Reply to Thread
Results 1 to 3 of 3

Run-time error '438': - trying to delete a chart on workbook close

  1. #1
    Forum Contributor
    Join Date
    08-03-2009
    Location
    Cary, NC
    MS-Off Ver
    Excel 2016
    Posts
    109

    Run-time error '438': - trying to delete a chart on workbook close

    I'm trying to delete a chart when I close a workbook using the following code:

    Please Login or Register  to view this content.
    but I'm getting error: Run-time error '438': Object doesn't support this property or method at .Charts("Defects Level 1").Activate. I've tried variations on .Charts, .ActiveChart, and .ChartObjects but I'm not having any luck. Any ideas?
    Last edited by bishoposiris; 02-10-2016 at 02:43 PM. Reason: Solved

  2. #2
    Forum Contributor
    Join Date
    08-03-2009
    Location
    Cary, NC
    MS-Off Ver
    Excel 2016
    Posts
    109

    Re: Run-time error '438': - trying to delete a chart on workbook close

    I was able to solve this by using the following code:

    Please Login or Register  to view this content.
    This deletes all the charts on all the sheets in my workbook. Hope this helps.

  3. #3
    Registered User
    Join Date
    01-22-2016
    Location
    Albany, NY
    MS-Off Ver
    2010
    Posts
    31

    Re: Run-time error '438': - trying to delete a chart on workbook close

    I got similar errors as you. However, this syntax seems to work if you just want to delete a particular chart on the worksheet:

    .ChartObjects("Defects Level 1").Delete

    I don't know if you really have to activate the chart first before deleting it.
    Last edited by JaguerRhye; 02-10-2016 at 03:33 PM.

+ 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] Auto Close Msg Box after Time Period & Close Workbook
    By GJF36 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-24-2015, 10:25 AM
  2. [SOLVED] Need VBA code to delete all data in FP:FP In mid bet Open and close workbook from path
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-04-2014, 05:27 AM
  3. [SOLVED] Closing a Workbook from another workbook: Workbooks.close error: Subscript out of range
    By Coreyusa in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-14-2013, 06:45 PM
  4. [SOLVED] Delete (kill) active workbook on close: Possible?
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-17-2006, 02:15 PM
  5. run-time error '91'-Close Button error
    By ASCO IS Help in forum Excel General
    Replies: 1
    Last Post: 05-08-2006, 11:30 AM
  6. run-time error '91' - Close Button Error
    By ASCO IS Help in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-22-2006, 01:10 PM
  7. [SOLVED] delete toolbar on workbook close
    By Papa Jonah in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-02-2005, 11:20 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