Is there a way using VBA or LISP to programmatically remove an embedded VBA project from a drawing? I found the code below. From my admittedly limited knowledge of LISP, it seems like it should do it. If I embed a projected and run it, it will detect it and ask if I want to remove it, but if I go to Tools->Macro->VBA Manager, it's still embedded. If I run it again, it won't detect it anymore. I'm using Autocad 2008.
Code:(defun c:rem_vba_proj (/ mac-attach ) (setq mac-attach (dictsearch (namedobjdict) "ACAD_VBA")) (if mac-attach (progn (getstring "\nFound embedded macro. Enter to delete, ESC to cancel...") (foreach name (massoc 350 mac-attach) (entdel name) ) (dictremove (namedobjdict) "ACAD_VBA") (command "qsave") ) ) ) (defun massoc (key alist / x nlist) (foreach x alist (if (eq key (car x)) (setq nlist (cons (cdr x) nlist)) ) ;end if ) ;end foreach (reverse nlist) ) ;end defun