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
 Forum for Origin C
 finding current worksheet

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
nbo10 Posted - 07/12/2006 : 10:54:59 AM
Origin Version (Select Help-->About Origin): 7.5
Operating System: XP

HI I need some help.

I want to write a script that will find the current worksheet and add Columns to it. I can write a script to add columns but it starts a new worksheet. Thanks
5   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 07/12/2006 : 1:30:50 PM
Hi,

You can search the programming help file with key words to find topics. For controlling window status, please look at the Window class under User Interface Controls. There is a ShowWindow method that has options to minimize, maximize, hide etc.

Easwar
OriginLab




Edited by - easwar on 07/12/2006 1:32:10 PM
nbo10 Posted - 07/12/2006 : 1:20:24 PM
Thanks,
One last question.

After I add the columns I then create a GraphPage & GraphLayer & Curve and this plot is maximized. I want the worksheet to stay maximized. I've searched through the help but can't find the right method. Thanks
easwar Posted - 07/12/2006 : 11:22:44 AM
Hi nbo10,

You need to change the page name and not the sheet name. In 7.5 there is only one sheet per page and the sheet name is something internal and is not used for display etc.

So try

WorksheetPage wpg=wks.GetPage();
wpg.Rename("newname");


Easwar
OriginLab

nbo10 Posted - 07/12/2006 : 11:17:01 AM
Thanks, That works get.

One more question. I can't seem to find a function to change the name of worksheets, I can wks.GetName(). Is there a methond to do this? I'm using OriginC.
easwar Posted - 07/12/2006 : 11:03:19 AM
Hi nbo10,

Not sure if you were looking for LabTalk script or Origin C code for this, so here is solution for both:

Easwar
OriginLab


// LabTalk Script
if(2 == exist(%h))
{
// active window is a worksheet;
// add columns etc using wks object;
wks.addcol(somename);
// see wks object for more methods/properties
}



// Origin C code
void add_col_current_sheet()
{
Worksheet wks = Project.ActiveLayer();
if( wks )
{
wks.AddCol("somename");
wks.GetPage().Refresh();
// see Worksheet class for more methods and properties
}
}




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