ERROR: Error handler re-entered. Exiting now.

Discussion in 'AutoCAD' started by spanqy, Sep 14, 2004.

  1. spanqy

    spanqy Guest

    I get the following error message when running code on a specific set of drawings (not all drawings). When I click OK, I am kicked complete out of AutoCAD and/or the VBA IDE.

    Title: AutoCAD Error-abort
    Msg: Error handler re-entered. Exiting now.

    My code is only trying to get a layer or create it if it does not exist. Something like:

    On Error Resume Next
    Dim objLayer As AcadLayer
    Set objLayer = ThisDrawing.Layers(strLayer)
    If ObjLayer Is Nothing then
    Set objLayer = ThisDrawing.Layers.Add(strLayer)
    End if

    As I mentioned, this problem is only happening with a certain crop of drawings that are nearly identical, so I would guess that something is probably just wacky with them (I have recovered & audited). Otherwise this utility works great.

    However, the brutality of the error and inability I have to track it down using regular debugging methods makes me curious as to what may be the exact cause. Has anyone else out there seen this before?


    Mark Sanchez
    spanqy, Sep 14, 2004
    1. Advertisements

  2. Mark,

    You can use a single line to do this...
    If the layer already exists, it will be returned to objLayer. If it
    doesn't, it will be created.

    James Belshan, Sep 14, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.