Exchange data with Excel

  • sabrina
  • Topic Author
More
29 Apr 2021 23:31 #9538 by sabrina
Exchange data with Excel was created by sabrina
Hi all, 
I have been reading the comments on how I can write a script with the SDK tool.
I tried to do a test by putting a file in the C drive calles 'test'
xlobject=xl_create;
xl_open(xlobject,"C:\test.xlsx");
data_str=xl_get(xlobject,"Mydata");
xl_close(xlobject);
xl_free(xlobject);
data=real_array(data_string);

I have the following message error when trying to run the script.
[1] referencing unassigned variable:xl_create
 
Is it possible to know why? are there any templates we can use which explains this better?

kind regards
Sabrina

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

  • Paul Gilman
More
03 May 2021 18:18 #9546 by Paul Gilman
Replied by Paul Gilman on topic Exchange data with Excel
Hi Sabrina,

The name "xl_create" is the name of a function, so you cannot use it as a variable name.

Please see these examples for how to use SAM to interact with Excel files:

github.com/NREL/SAM/tree/develop/samples/Excel%20Exchange

Note that these functions only work with Windows versions of SAM.

Best regards,
Paul.

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

Moderators: Paul Gilman
Powered by Kunena Forum