I have a lisp file that works with Excel, with funtions for both reading and writting.
On the reading functions, I'd like to check the Cell formating to determine if the value is string, real, or integer, so I can save the correct lisp datatype when I save the value for later processing.
The Get-Cell function is probably where I need the change... I can pretty much guess at what get property function to call... but am not certain past this.
Could anyone provide a direction I might look at?
(defun Get-CellValue (row ; the row number
col ; the column number
xlapp ; the running instance of excel
)
(vlax-variant-value
(xlsp-get-value ; get the value of the cell
(Get-Cell ; reference the cell
(xlsp-get-ActiveSheet xlapp) ; reference the active xls sheet
row ; the row number of the record
col ; the column number of the record
)
)
)
)
(defun Get-Cell (rng row col)
(vlax-variant-value
(xlsp-get-item
(xlsp-get-cells rng)
(vlax-make-variant row vlax-vbLong) ; converts integer to a variant data type
(vlax-make-variant col vlax-vbLong) ; converts integer to a variant data type
)
)
)