2004 bug?

Discussion in 'AutoCAD' started by caduser77, Jan 15, 2005.

  1. caduser77

    caduser77 Guest

    Can anyone tell me why the following piece of code would result in an
    "run time error key not found". I use 2002 at work and the rest of
    this code works fine, but with 2004 at home it doesn't. What did I
    miss?

    Public Static Function blockin()
    On Error Resume Next

    Set clayer = ActiveDocument.ActiveLayer
    Set layobj = ThisDrawing.Layers.Item(layername)
    If Err <> 0 Then
    'Debug here->' Set layobj = ThisDrawing.Layers.Add(layername)
    layobj.Color = layercolor
    End If
    ActiveDocument.ActiveLayer = layobj
     
    caduser77, Jan 15, 2005
    #1
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.