How to run SAM script from Excel file and output to the same excel file.

  • David.Garza
  • Topic Author
More
08 Sep 2016 17:45 #4747 by David.Garza
Hi,

I have a LX script which I would like to modify so that the script opens an excel file I direct it to. It then runs the script for all of the data from a selected area and outputs the results in designated cells in the same excel file.

Would that be possible and how would I go about adding that feature to my current script?

Best,
David

Please Log in or Create an account to join the conversation.

  • pgilman
More
12 Sep 2016 15:44 #4748 by pgilman
Dear David,

You could use the csvread() and csvwrite() functions as in the example on the Samples page (it should be #6 at the moment).

If you are running the script on a Windows computer, you could use the Excel functions. You can find them in the Function Reference by clicking "Functions" in the script editor window, and then typing the word "Excel" in the Search box to filter the results. The Excel functions all start with "xl_," for example xl_create() creates a new OLE automation object, and xl_set() assigns a value to a cell or range in an Excel workbook.

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

Moderators: pgilman
Powered by Kunena Forum