Author |
Topic  |
|
LarsVSA
Germany
2 Posts |
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 |
|
Mike Buess
USA
3037 Posts |
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 |
 |
|
LarsVSA
Germany
2 Posts |
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
USA
3037 Posts |
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 |
 |
|
|
Topic  |
|
|
|