Quit Method (ActiveX)

Closes the drawing file and exits the AutoCAD application.

Supported platforms: Windows only

Signature

VBA:

object.Quit
object

Type: Application

The object this method applies to.

Return Value (RetVal)

No return value.

Remarks

If AutoCAD is in the middle of a command, an "AutoCAD unable to service automation request" error message will be generated. If the document has not been saved, you will be prompted to save the drawing.

Examples

VBA:

Sub Example_Quit()
    ' Warning: This example will quit AutoCAD and VBA.
    
    ThisDrawing.Application.Quit
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Quit()
    ;; Warning: This example will quit AutoCAD.
    (setq acadObj (vlax-get-acad-object))
    (vla-Quit acadObj)
)