You can use this function to populate fields by reading the information you need from the excel file and setting it as a variable in lisp.
In autocad put the variable and have it read that lisp variable.
(defun getCellsFunction(fileName sheetName cellName / myXL myBook mySheet myRange cellValue)
(setq myXL(vlax-get-or-create-object "Excel.Application"))
(vla-put-visible myXL :vlax-false)
(vlax-put-property myXL 'DisplayAlerts :vlax-false)
(setq myBook (vl-catch-all-apply 'vla-open (list (vlax-get-property myXL "WorkBooks") fileName)))
(setq mySheet (vl-catch-all-apply 'vlax-get-property (list (vlax-get-property myBook "Sheets") "Item" sheetName)))
(vlax-invoke-method mySheet "Activate")
(setq myRange (vlax-get-property (vlax-get-property mySheet 'Cells) "Range" cellName))
(setq cellValue(vlax-variant-value (vlax-get-property myRange 'Value2)))
(vl-catch-all-apply 'vlax-invoke-method (list myBook "Close"))
(vl-catch-all-apply 'vlax-invoke-method (list myXL "Quit"))
(if (not (vlax-object-released-p myRange))(progn(vlax-release-object myRange)(setq myRange nil)))
(if (not (vlax-object-released-p mySheet))(progn(vlax-release-object mySheet)(setq mySheet nil)))
(if (not (vlax-object-released-p myBook))(progn(vlax-release-object myBook)(setq myBook nil)))
(if (not (vlax-object-released-p myXL))(progn(vlax-release-object myXL)(setq myXL nil)))
(if(= 'safearray (type cellValue))
(progn
(setq tempCellValue(vlax-safearray->list cellValue))
(setq cellValue(list))
(if(= (length tempCellValue) 1)
(progn
(foreach a tempCellValue
(if(= (type a) 'LIST)
(progn
(foreach b a
(if(= (type b) 'LIST)
(setq cellValue(append cellValue (list (vlax-variant-value (car b)))))
(setq cellValue(append cellValue (list (vlax-variant-value b))))
)
)
)
(setq cellValue(append cellValue (list (vlax-variant-value a))))
)
)
)
(progn
(foreach a tempCellValue
(setq tmpList(list))
(foreach b a
(setq tmp(vlax-variant-value b))
(setq tmpList(append tmpList (list tmp)))
)
(setq cellValue(append cellValue tmpList))
)
)
)
)
)
cellValue
)
(getCellsFunction "PUT FILE PATH HERE" "ENTER EXCEL SHEET NAME HERE (SHEET 1)" "ENTER CELL(S) HERE (A1:B10)")
Set the variable like this.
(setq test_number (getCellsFunction "PUT FILE PATH HERE" "ENTER EXCEL SHEET NAME HERE (SHEET 1)" "ENTER CELL(S) HERE (A1:B10)")
Im not that great at this stuff so some one correct me if this isnt a good solution.
This is what I am using to auto-populate all kinds of information for our projects i just put them in the template and find the excel file based on the dwg name.......
Good luck