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
 Copy wks-Data in Excel workbook

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
LarsVSA Posted - 06/18/2007 : 04:43:03 AM
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
3   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 06/18/2007 : 10:08:37 AM
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
LarsVSA Posted - 06/18/2007 : 09:19:36 AM
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
Mike Buess Posted - 06/18/2007 : 07:56:51 AM
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

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