VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

autocad error codes

6 REPLIES 6
Reply
Message 1 of 7
fxcastil
15928 Views, 6 Replies

autocad error codes

Where do I find a list of error codes for Autocad VBA. I searched this group for this topic. This question has been asked a few times but never answered ??

Fred C
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: fxcastil

Hi Fred,

VBA help states that error code numbers can be anything from 0 - 65535 with
0 - 512 being reserved for VBA and the rest user defined. Maybe the "Raise"
method can give you what you need.

Gary

Dim x As Long

On Error Resume Next

For x = 0 To 512
Err.Raise x
Debug.Print x & vbTab & Err.Description
Err.Clear
Next
Message 3 of 7
nyme
in reply to: fxcastil

Sorry, but no good. Error numbers are mapped to the description. 0 to 512 are Visual Basic errors (type mismatch, block variable width not set, ..), and the rest is for you, or AutoCAD, or whatever....

But you wont get more info on the error then the error's description from the number. Moreover, AutoCAD's raises are all messed up. You cant realy get that mutch info from them other than "Method XXXXXX of the interface IACADXXXX faled !" I have documented all errors manually with common causes/fixes in our context, but everyone's is different......

Hope this sends you in the right direction!
Message 4 of 7
fxcastil
in reply to: fxcastil

Nyme,
I know that error codes 0 - 512 are VBA eror codes
see list below. I was looking for AutoCad error codes
numbers like -2145386420. The only way I know of ACad error codes is to cause erros. I handle lots of error
like this

err.clear
on error resume next

Set objBlockRef = .ModelSpace.InsertBlock(insertionPnt, strDwgWithPath, 1#, 1#, 1#, 0)
If err <> 0 then
msgbox " error inserting block " & strDwgWithPath
err.clear
end If

Fred C



' ************************************************
' ********** VBA Error Codes **************************
'

'3 Return without GoSub
'5 Invalid procedure call
'6 Overflow
'7 Out of memory
'9 Subscript out of range
'10 This array is fixed or temporarily locked
'11 Division by zero
'13 Type mismatch
'14 Out of string space
'16 Expression too complex
'17 Can 't perform requested operation
'18 User interrupt occurred
'20 Resume without error
'28 Out of stack space
'35 Sub, Function, or Property not defined
'47 Too many code resource or DLL application clients
'48 Error in loading code resource or DLL
'49 Bad code resource or DLL calling convention
'51 Internal Error
'52 Bad file name or number
'53 File Not found
'54 Bad file mode
'55 File already open
'57 Device index/O error
'58 File already exists
'59 Bad record length
'61 Disk full
'62 Input past end of file
'63 Bad record number
'67 Too many files
'68 Device unavailable
'70 Permission denied
'71 Disk Not Ready
'74 Can 't rename with different drive
'75 Path/File access error
'76 Path Not found
'91 Object variable or With block variable not set
'92 For loop not initialized
'93 Invalid pattern string
'94 Invalid use of Null
'97 Can 't call Friend procedure on an object that is not an instance of the defining class
'98 A property or method call cannot include a reference to a private object, either as an argument or as a return value
'298 System resource or DLL could not be loaded
'320 Can 't use character device names in specified file names
'321 Invalid file format
'322 Can’t create necessary temporary file
'325 Invalid format in resource file
'327 Data value named not found
'328 Illegal parameter; can't write arrays
'335 Could not access system registry
'336 Component not correctly registered
'337 component Not found
'338 Component did not run correctly
'360 Object already loaded
'361 Can 't load or unload this object
'363 Control Not Specified
'364 Object was unloaded
'365 Unable to unload within this context
'368 The specified file is out of date. This program requires a later version
'371 The specified object can't be used as an owner form for Show
'380 Invalid property value
'381 Invalid property-array index
'382 Property Set can't be executed at run time
'383 Property Set can't be used with a read-only property
'385 Need property-array index
'387 Property Set not permitted
'393 Property Get can't be executed at run time
'394 Property Get can't be executed on write-only property
'400 Form already displayed; can't show modally
'402 Code must close topmost modal form first
'419 Permission to use object denied
'422 Property not found
'423 Property or method not found
'424 Object required
'425 Invalid object use
'429 component Can 't create object or return reference to this object
'430 Class doesn 't support Automation
'432 File name or class name not found during Automation operation
'438 Object doesn 't support this property or method
'440 AutomatiOn Error
'442 Connection to type library or object library for remote process has been lost
'443 Automation object doesn't have a default value
'445 Object doesn 't support this action
'446 Object doesn 't support named arguments
'447 Object doesn 't support current locale setting
'448 Named Not Argument
'449 Argument not optional or invalid property assignment
'450 Wrong number of arguments or invalid property assignment
'451 Object not a collection
'452 Invalid ordinal
'453 Specified code resource not found
'454 Code Not resource
'455 Code resource lock error
'457 This key is already associated with an element of this collection
'458 Variable uses a type not supported in Visual Basic
'459 This component doesn't support the set of events
'460 Invalid Clipboard format
'461 Method or data member not found
'462 The remote server machine does not exist or is unavailable
'463 Class not registered on local machine
'480 Can 't create AutoRedraw image
'481 Invalid Picture
'482 printer Error
'483 Printer driver does not support specified property
'484 Problem getting printer information from the system. Make sure the printer is set up correctly
'485 Invalid picture type
'486 Can 't print form image to this type of printer
'520 Can 't empty Clipboard
'521 Can 't open Clipboard
'735 Can 't save file to TEMP directory
'744 Search Not text
'746 Replacements too long
Message 5 of 7
sendtosandee
in reply to: fxcastil

We are getting this error 52 (bad file name or number ) when we try to save an autocad drawing as pdf. How to resolve this?

Tags (1)
Message 6 of 7
dsnyder
in reply to: fxcastil

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!

Message 7 of 7
Ed.Jobe
in reply to: dsnyder

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

 

Ed

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost