Try catch RRS feed

  • Question


    I have created a toolbar menu, on workbook.vb. These call sub or functions on sheet1.vb.

    Try catch isn't working when this is run! it just closes excel down when an error occurs!
    If i put a button on the sheet then its possible to use the try catch

    Has anyone got any ideas oon how to enable try catch



    Friday, October 5, 2007 7:47 AM


All replies

  • It sounds like you are getting a JIT-time error rather than a runtime error. The CLR JIT compiles code on a method level, so if there is a JIT time exception try\catch within that method won't catch it. Try moving the code into another method and put try\catch around that function call and see if that helps.


    It will help us if you show us some code for a repro case as well.


    Friday, October 5, 2007 7:09 PM
  • Thomas thanks for your reply

    It seems to be any error the sheet will crash

    in this workbook

    I have created a toolbar menu

    which calls a function on sheet1

    If I create a button on the sheet the try catch seems to work and directs me into the error.




    Sunday, October 7, 2007 10:58 AM
  • After Installing SP1 this is now working


    Thursday, October 11, 2007 9:32 AM