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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Copy wks-Data in Excel workbook
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

LarsVSA

Germany
2 Posts

Posted - 06/18/2007 :  04:43:03 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

i want to copy two whole columns of an Origin worksheet into two columns of an Excel Workbook which i create whithin Origin, beginning in the Excel workbook at the third row, because in the two first are already some string characters for the following use.

Until now i did by the script code like this

maxrows=Data1!wks.maxrows;
repeat maxrows (
%(ProgrammData,@DN,A,i+2)=%(Data1,1,i);
%(ProgrammData,@DN,B,i+2)=%(Data1,2,i);
i=i+1;
);

but this takes a lot of time (about 10 minutes), because there are at about 60000 rows. Doing copy by hand this take only a few seconds...

So how can i do this in a faster way by script?

Thank you very much for an answer.

Lars

Mike Buess

USA
3037 Posts

Posted - 06/18/2007 :  07:56:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Lars,

Use this to copy entire columns to the active Excel sheet...

%(ProgrammData, @DN, A) = %(Data1,1);
%(ProgrammData, @DN, B) = %(Data1,2);

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 06/18/2007 07:57:51 AM
Go to Top of Page

LarsVSA

Germany
2 Posts

Posted - 06/18/2007 :  09:19:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

to copy a whole column your solution works, as i found in the help file.

But my special problem is, that i want to start to fill up the Excel workbook from the third row on, and therefore with a two row shift according to the Origin wks, because in the first two rows in the workbook are some characters for the programm, which will use the workbook file next.

I found a solution combining an answer by Ryan in a topic long ago, http://www.originlab.com/forum/topic.asp?TOPIC_ID=1650 appending two empty rows at the beginning of the workbook after copying.

Is this an effective way or can you recommend a better one?

Thanks,
Lars
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 06/18/2007 :  10:08:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This is probably easier...

npt=Data1!wks.maxrows - 2;
copy -b 3 %(Data1,1) %(ProgrammData, @DN, A) -b 1 -e npt;
copy -b 3 %(Data1,2) %(ProgrammData, @DN, B) -b 1 -e npt;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 06/18/2007 10:12:45 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000