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

Post HOSTNAME to Excel (LISP)

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
782 Views, 2 Replies

Post HOSTNAME to Excel (LISP)

Anyone have a lisp routine that can write to an already existing XLS file?  What i need is an Excel file that will be updated with a users 'hostname' when they start AutoCAD.  I can get the hostname information with the below code, but I'm not sure how to get this value into an Excel file.

 

(getenv "computername")

 

Thanks for any help.

 

2 REPLIES 2
Message 2 of 3
BlackBox_
in reply to: Anonymous

Out of curiosity, if all you're writting to the file is the hostname, why .XLS(x), and not either .TXT, or .CSV, etc.?

 

There are a few ways of going about writing to .XLS(x), but you've not provided enough information... What format is your external workbook, what other information are you writing to this file, what version of Office are you using, etc.?



"How we think determines what we do, and what we do determines what we get."

Message 3 of 3
Anonymous
in reply to: BlackBox_

I can already post to a TXT file. (see below code)

Just wanted to see if there was an easy way to post to an XLS file.

 

(setq LOGN (STRCAT (getvar "loginname") ", "(getenv "computername")))

(setq l_file (open fname "A"))(write-line LOGN l_file)(close l_file)

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

Post to forums  

Autodesk Customer Advisory Groups


Autodesk Design & Make Report