Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Help With VBA Making A Chart Last Bit Of Help I Need Please!

  1. #11
    New Member
    Join Date
    Apr 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    sorry, I was wrong on the above code, the problem is on error goto 0 reset err code to 0.

    the correct code are:

    dim cht as chart

    on error resume next

    set cht = activeworkbook.chart("YourChartNameHere") 'your actual chart name

    if err = 0 then
    cht.delete
    end if

    cht.add

    your rest code here...

    HTH
    lantiger







  2. #12
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    thank you it's good that someone can help instead of getting into a moral debate

  3. #13
    New Member
    Join Date
    Apr 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    blame it on the stupid lunch I had today

    anyway, the above code works, but not perfect. here we go again

    dim cht as chart

    on error resume next

    set cht = activeworkbook.chart("YourChartNameHere") 'your actual chart name

    if err = 0 then
    application.DisplayAlerts = False
    cht.delete
    application.DisplayAlerts = true
    end if

    on error goto 0

    cht.add

    your code...

    HTH
    lantiger

  4. #14
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    thanks I got it working now and for Mark yes I will be reading the code seeing how it executes the operations and dsorry if am here is a future apology if I become mentally challenged in the future over Excel.

  5. #15
    New Member
    Join Date
    Apr 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    where is my chocolate medallion?

    glad you got the code working.

    lantiger

  6. #16
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-11 11:48, Morrissey wrote:
    thanks I got it working now and for Mark yes I will be reading the code seeing how it executes the operations and dsorry if am here is a future apology if I become mentally challenged in the future over Excel.
    Is that my name being mentioned in this thread? I haven't contributed anything to it, apart from this post.

    Quick word of advice though (and at 16/17 I didn't know this either), it doesn't matter what your teacher can or cannot teach you when there are literally hundreds of books on the subject out there in circulation.

    I used to work for a small company (I was a consultant engineer and a secretary for a time) and we didn't have cash to splash on books let alone training. Let me tell you this, it didn't take me 6 weeks to learn the basics of VBA by going to the library across the road.

    Anyway, seriously, good luck with your A Level.

  7. #17
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thank you for your support about my A level and I am learning VB during my Summer Vacation in preperation for the Access project and I could learn VBA in 6 weeks however I have 3 other subjects where I must learn facts aswell

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •