I have found it next to impossible to grasp, or learn from 2018 AutoCAD without having the definitions to the error codes! How and where do I get these illusive little devils?!? I have several projects on hold because I can not figure out why the program does not function as it should, or complete the task at hand!
What I do is use an error handler like the code shown below. I then set a break point in the sub and step through the code to find out what the error is. Then I modify the select case section to add a handler for the newly found error. Add a watch for Err.Number to see what the error is.
Sub Test() On Error GoTo Err_Control 'main work goes here 'Add line labels to return to various places in your logic. Exit_Here: Exit Sub Err_Control: Select Case Err.Number 'Add your Case selections here 'Case Is = 1000 'Handle error 'Err.Clear 'Resume Exit_Here Case Else MsgBox Err.Number & ", " & Err.Description, , "Test" Err.Clear Resume Exit_Here End Select End Sub