The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Failed to resolve range string

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ano32 Posted - 10/24/2016 : 04:54:22 AM
Origin 8 SR0
v8.0725 (B725)
win10

Hello!

I have 140 columns with 1024 rows and would like to copy rows 570 to 770 of each column to different sheet. I use this "script" in the script window next to the workbook:

loop (ii, 2, 141){copydata irng:=[book4]sheet!col(ii)[570:770] orng:=[book4]copied;};

But this error occurs:

Failed to resolve range string, VarName = irng, VarValue = [book4]sheet!col(ii)[570:770]

Please help.

Best regards Ondřej Cibulka
5   L A T E S T    R E P L I E S    (Newest First)
ano32 Posted - 11/11/2016 : 05:56:57 AM
Hello!

Thank you very much for your help. I try to program my script in new Origin file and it works now!

Best regards Ondřej
ano32 Posted - 10/26/2016 : 04:19:56 AM
Thank you very much for your help. I replay your example in my Origin document and it did not work (error "Fail to copy data range" occured). But when I tried it in new Origin document, it works! So I will try manipulation with my data in a new file and I will give you a feedback.

Thank you again. Ondřej
yuki_wu Posted - 10/24/2016 : 10:56:39 PM
Hi,

At first, I don’t think your Czech version is a problem.

In order to illustrate more clearly, let me take a simple example:
There are 5 columns in my data, and I want copy each row 15-20 of column 2-5 to a new worksheet respectively.

1. Check the name of workbook and worksheet that should point to your data correctly in the script.


2. Run the script to see if it can be successful to copy only one column to a new worksheet

copydata irng:=[book1]sheet1!col(2)[15:20] orng:=<new>!<new>;



3. Need to loop over the columns now, please go to this page and find out how to loop the columns:
http://www.originlab.com/doc/LabTalk/guide/Looping-Over-objs#Looping_over_Columns_and_Rows

loop (ii, 2, 5){copydata irng:=[book1]sheet1!col($(ii))[15:20] orng:=<new>!<new>;}

Note that $ should be added in col() of a loop



BTW, I have a small tip. If you want to know more about copydata, you can type “copydata -d” and hit ENTER in Command window. A dialog will be brought up. You can specify the input and output in the flyout by clicking the triangle button. At last, you select the triangle button at the top and select Generate Script, you can see the script shows on the Command window.


Hope this can be some help.

Regards,
Yuki
OriginLab
ano32 Posted - 10/24/2016 : 09:49:04 AM
Thank you. It do not work, the error is still the same:

Failed to resolve range string, VarName = irng, VarValue = [book4]sheet1!col(1)[570:770]

Only difference is that the number in brackets after col() changes after start number in loop function.

Is the problem connected with data in the sheet? I have Czech version of Win10 and Origin uses , instead of . in numbers (3,1415). But graphs and all other computation are OK.
yuki_wu Posted - 10/24/2016 : 05:38:34 AM
Hi,

You can try the following script:

loop (ii, 2, 141){copydata irng:=[book4]sheet1!col($(ii))[570:770] orng:=<new>!<new>;}

Hope it works.

Regards,
Yuki
OriginLab

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000