Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Excel Lisp check cell formatting and proper translation.

0 REPLIES 0
Reply
Message 1 of 1
mdhutchinson
653 Views, 0 Replies

Excel Lisp check cell formatting and proper translation.

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
   )
  )
)

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost