I asked the same question in one of the forums and did not get an answer, its about getting the property "selected range" from excel, VL lisp lets you read properties out of excel. Your after say A1:C23 so can do a row column read of cells in correct order.
This is what needed but in VL
Worked it out a start I have not included the open excel etc so it looks for an application myxl.
; get current range selected in excel
; By Alanh Nov 2021
; ColumnRow - Returns a list of the Column and Row number
; Function By: Gilles Chanteau from Marseille, France
; Arguments: 1
; Cell$ = Cell ID
; Syntax example: (ColumnRow "ABC987") = '(731 987)
;default to "A1" if there's a problem
;-------------------------------------------------------------------------------
(defun ColumnRow (Cell$ / Column$ Char$ Row#)
(setq Column$ "")
(while (< 64 (ascii (setq Char$ (strcase (substr Cell$ 1 1)))) 91)
(setq Column$ (strcat Column$ Char$)
Cell$ (substr Cell$ 2)
)
)
(if (and (/= Column$ "") (numberp (setq Row# (read Cell$))))
(list (Alpha2Number Column$) Row#)
'(1 1)
)
)
; Alpha2Number - Converts Alpha string into Number
; Function By: Gilles Chanteau from Marseille, France
; Arguments: 1
; Str$ = String to convert
; Syntax example: (Alpha2Number "ABC") = 731
;-------------------------------------------------------------------------------
(defun Alpha2Number (Str$ / Num#)
(if (= 0 (setq Num# (strlen Str$)))
0
(+ (* (- (ascii (strcase (substr Str$ 1 1))) 64) (expt 26 (1- Num#)))
(Alpha2Number (substr Str$ 2))
)
)
)
; thanks to Lee-mac for this defun
; 58 is Colon
(defun csv->lst ( str / pos )
(if (setq pos (vl-string-position 58 str))
(cons (substr str 1 pos) (csv->lst (substr str (+ pos 2))))
(list str)
)
)
(defun getrangexl ( / lst UR CR RADD )
(setq lst '())
(setq UR (vlax-get-property (vlax-get-property myxl "ActiveSheet") "UsedRange"))
(setq CR (vlax-get-property UR "CurrentRegion"))
(setq RADD (vlax-get-property CR "Address"))
(setq lst (csv->lst radd))
(setq st (vl-string-subst "" "$" (vl-string-subst "" "$" (nth 0 lst) )))
(setq end (vl-string-subst "" "$" (vl-string-subst "" "$" (nth 1 lst) )))
(setq st (columnrow st))
(setq end (columnrow end))
(princ st)
(princ "\n")
(princ end)
)
(getrangexl)
To run say in conjunction with getexcel.lsp
(alert "select rang in excel")
; go pick range excel
(getrangexl)
; row colum start
; row column end