Doug and Tony pointed out how to close a dbx doc.
Even after learning the how, I still found myself more comfortable with a reasurring looking statement like (closeDBX oDbxDoc) that would return a comforting message telling me it worked. Guess this classifies as psychotic ....I mean psychological... programming

so I can go like (if (closeDBX oDbxDoc "save" "savedByDbx.Dwg")(alert"now i can sleep at night")(alert"hmmm....now what did I do wrong?")) ; gleaned from various ng posts, modified ...or is that mutilated...by mark propst ; thanks to Tony Tanzillo, Luis Esquivel, Michael Puckett, Frank Oquendo, James Buzzbee, Doug Broad et al ; for their unselfish generosity in sharing their knowlege about this undocumented feature set ; Especial thanks to Tony for his many examples which show even a dummy like me how to use Dbx ;google is a goldmine of info on objectDBX ;whatever is lame in the following code is totally my doing ;whatever is good is due to the above mentioned contributors and others posts ; Closes a dbx Document and saves or not. ; Called thus:
; (CloseDbx oDbxDoc 1 "path\\NewName.Dwg"); to save as a new name ;(CloseDbx oDbxDoc 1 nil); to save as existing name ;(CloseDbx oDbxDoc nil nil); to close but not save ;Returns nil on error or failure, 1 on success (defun CloseDbx (inDoc saveYes fname / res ) (if (and inDoc ;(=(Type inDoc)'VLA-OBJECT)..or something to that effect (not(vlax-object-released-p inDoc)) );and (progn ;if asked to save, do so (if SaveYes (saveDbx inDoc fname) ) ;try to release object (if(vl-catch-all-error-p (vl-catch-all-apply 'vlax-release-object (list inDoc) ) (progn ;(princ"\n*****Error releasing Dbx document*****");just for debugging sake nil;return nil on error );pro ;else clean up (progn ;(prind"\nDbx document released") ;just for debugging sake (gc)(gc);i saw this posted by people who should know so it's got to be a good thing!

1;return 1 on success ) ;pro );if );pro (progn ;(prind"Object nil or already released");just for debugging nil );pro );if rtn );close
;based on original code from james buzbee's versions
(defun saveDbx (object oname / res fname)
(or (setq fname oname);if name arg is not nil, try to use it (setq fName(vlax-get-property object 'name));else use existing document name ) (if (vl-catch-all-error-p (vl-catch-all-apply 'vlax-invoke-method (list object 'saveas fName)
))
(progn
;(print"Error saving Dbx")
nil;return value of nil for failure
);progn
(progn
;(princ(strcat "\nSuccessfully saved Dbx: " fname));debug 1;return value of 1 for success );progn );if )
hth
Mark