T O P I C R E V I E W |
duffy01 |
Posted - 08/20/2014 : 05:06:59 AM Origin Ver. : 8.5.0G SR1 Operating System: Win 7
Hi,
sorry for the maybe dumb question but this problem drives me crazy since some time within different circumstances. I read Helpfiles a lot but don`t get it and I want to understand now.
Basic Idea is, to work between columns in different worksheets, maybe also in different Workbooks. Since I want to reuse the scripts for different purposes, I want to be able to just change Worksheetnames (Sometimes also Workbooknames and Columnnames) only in the headerin order to make the script work.
My way is to setup a two range variables for both sheets, e.g:
range aWks=!; range eWks=[Book1]Ergebnis!;
typically I want to reference on a certain column using xfuncionts etc. In many cases I am able to do that via substitution notation, but I almost always have to try several times to find out which is the correct way, and sometimes I am not able. Let`s give an example:
I want to start by inserting a noew column in eWks: eWks.insert (new); // works
But since I want to assure, that it is inserted as second column I would like to take care about it via Labtalk before. So I insert something like this before: eWks.col=2; // Doesn't work, because Origin seems always to use the activated Worksheet as reference.
Same accounts, when I try to change values of user parameters. But it works fine using the above mentioned notation, when I try to change type of col… eg: eWks.col2.type=4; // Works
Could somebody explain me what I do not understand in the progamming concept or give me a short code example, which explains this, without changing the active Workbook?
Thanks in a advance Martin |
1 L A T E S T R E P L I E S (Newest First) |
greg |
Posted - 08/20/2014 : 09:12:27 AM This should always work:
range eWks = [Book1]Ergebnis!; eWks.col = 2; eWks.insert(new); eWks.col2.type = 4;
regardless of what sheet it active or where [Book1]Ergebnis is in your project.
This code range aWks=!; will only create a sheet range out of the active worksheet.
So I am not sure what problem you are having. |
|
|