A very quick & dirty lisp:
Code:
(vl-load-com)
(defun c:Tbl2Csv (/ block eo f n row col str val)
(setq n 0)
(vlax-for block (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-acad-object)))
(vlax-for eo block
(if (eq (vla-get-ObjectName eo) "AcDbTable")
(progn
(setq n (1+ n) row -1 f (open (strcat (getvar 'DwgPrefix) (vl-filename-base (getvar 'DwgName)) "-Table" (itoa n) ".CSV") "w"))
(while (< (setq row (1+ row)) (vla-get-Rows eo))
(setq col -1 str "")
(while (< (setq col (1+ col)) (vla-get-Columns eo))
(setq val (vl-catch-all-apply 'vlax-invoke (list eo 'GetCellValue row col)))
(cond
((= (type val) 'STR) (setq str (strcat str ",\"" val "\"")))
((= (type val) 'INT) (setq str (strcat str "," (itoa val))))
((= (type val) 'REAL) (setq str (strcat str "," (rtos val))))
(t (setq str (strcat str ",")))
)
)
(write-line (substr str 2) f)
)
(close f)
)
)
)
)
(princ)
)
It simply saves each table found in the drawing to a CSV file named the same as the drawing with a suffix of -Table1, -Table2, ... TableN.
It would be possible to directly save into an XLS(x) file, but that's a "bit" more programming.