Origin Ver. and Service Release (Select Help-->About Origin): 9.0.0 Operating System: Win 7
Hello Guys,
at first please note I am totally new to programming. Im stuck at a pretty basic function as I am trying to import csv files from our spectrometer. Frist baby steps are:
I want origin to import the file and put it in a new workbook. I therefore use the tree options... to define this.
Hence, Origin responds with "command error" No workbooks are open yet when Im entering these lines in the command window. adding "newbook;" at the start of my lines seems so solve the problem somehow. It leaves me with alot of questions marks why options... is irgnored/interpretated incorrectly
All X-Function parameters have default values. When you do not specify a parameter value, Origin uses the default value. In this case, you did not specify the orng value so the function assumes the active window is a Workbook and will fail if it is not.
thank you so much for your fast resposne, i appreciate it.
I thought we solved it as no command error message was given. Hence, i found out that more likely this happened due to the usage of origin on my laptop, which hast V 9.3.226 on it. Here, no command error was recieved neither using double quotes nor without them.
Hideo's example of adding quotes to a string variable is incorrect. When using string variable there is no issues with spaces in the file path.
The key is that the impscv function import a file to an existing book, so you must first have a workbook before you can use this x-function, like you have found out.
It is true that this x-function should report proper error when the input book does not exist.