Im getting an error from a lisp routine im writing. The lisp takes all open drawings and creates an index of all the open drawings in alpha/numerical order. When the command is issued the drawing will switch to the next DWG in line alphabetically. This all works fine however. The problem is that I get the error: ; error: Exception occurred: 0xC0000005 (Access Violation) ; error: Unknown exception occurred ; warning: unwind skipped on unknown exception I have seen this problem posted before and the reason that I repost this error is that it seems to be caused by another error i get if I try to EXIT Acad with drawings open that have been activated by this code. I get this statement from Acad (alert box): AutoCad cannot close xx1.dwg; because there is a command still active. Please complete the command and try agian. My question (finally) is this: Is there a way for me to complete the command in the "background". The command not completing is from the lisp routine. If I switch back to the drawing that still has an active command it will pass 2 empty command lines: Command: (Index_Scroll "D") Command: Command: Ocassionally, enough of these errors will crash cad without warning .. poof no cad/no save :( Below is the code snipet, Its a work in progress and is incomplete but functional. (defun Gen_Index ( ) (setq acadobject (vlax-get-Acad-Object)) (setq documentcollection (vla-get-documents acadobject)) (SETQ DOCUMENTCOUNT (VLA-GET-COUNT DOCUMENTCOLLECTION)) (SETQ TMPCNT 0) (SETQ DOC_LIST NIL) (SETQ DOC_LIST_INDEX NIL) (WHILE (< TMPCNT DOCUMENTCOUNT) (SETQ DOC_LIST (APPEND DOC_LIST (LIST (VLA-GET-NAME (vla-item documentcollection TMPCNT))))) (SETQ DOC_LIST_INDEX (APPEND DOC_LIST_INDEX (LIST (CONS TMPCNT (VLA-GET-NAME (vla-item documentcollection TMPCNT)))))) (SETQ TMPCNT (1+ TMPCNT)) ) (SETQ DOC_LIST_INDEX DOC_LIST ) (SETQ DOC_LIST (VL-SORT DOC_LIST '<)) (SETQ DOC_LIST_CNTR 0) (SETQ TEMP_INDEX NIL) (FOREACH DWG_NAME DOC_LIST (SETQ TMP_CNTR 0) (WHILE (/= DWG_NAME DWG_INDEX) (SETQ DWG_INDEX (NTH TMP_CNTR DOC_LIST_INDEX)) (SETQ TMP_CNTR (1+ TMP_CNTR)) ) (SETQ TEMP_INDEX (APPEND TEMP_INDEX (LIST (NTH DOC_LIST_CNTR DOC_LIST) (1- TMP_CNTR)))) (SETQ DOC_LIST_CNTR (1+ DOC_LIST_CNTR)) ) (vl-propagate 'temp_index) (vl-propagate 'ACADOBJECT) (vl-propagate 'documentcollection) ) ; move down code BELOW (defun Go_Dn () (SETQ DOCUMENT_NUMBER (NTH 3 (MEMBER (getvar 'dwgname) TEMP_INDEX))) (VLA-PUT-ACTIVEDOCUMENT ACADOBJECT (vla-item documentcollection DOCUMENT_NUMBER)) (PRINC) ) ;move up code (defun Go_Up () (SETQ DOCUMENT_NUMBER (NTH (1- (vl-position (getvar 'dwgname) TEMP_INDEX)) TEMP_INDEX)) (VLA-PUT-ACTIVEDOCUMENT ACADOBJECT (vla-item documentcollection DOCUMENT_NUMBER)) (PRINC) ) ; trigger code below (defun Index_Scroll (Direction) (Gen_Index) (if (EQUAL (strcase direction) "U") (Go_Up)) (if (EQUAL (strcase direction) "D") (Go_Dn)) (PRINC) )