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
 Forum for Origin C
 Navigating the OriginObject
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

drew

USA
Posts

Posted - 06/06/2008 :  2:29:38 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5 SR6
Operating System: Windows XP

I'm having trouble finding my way around the OriginObject.

For example:
I create a worksheet where I want to store results from statistic calculations from many different worksheets. I want to flip back and fourth between each worksheet that requires calculations and my results worksheet.

When the results worksheet is not active I can find the WorksheetPage with:
wpResults = Project.WorksheetPages("Results");

However to record my data in the cells I really want the worksheet object. I haven't yet found an easy way to get to the worksheet! Help!

Appreciate any advice. If there is some reading that I have missed to help me understand this please let me know.

Thanks!

greg

USA
1380 Posts

Posted - 06/10/2008 :  5:12:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Since one of the Worksheet constructors takes a name you can use:

Worksheet wks(wpResults.GetName());
if(wks.IsValid()) wks.AddCol("NewColumn");
or just
Worksheet wks("Results");
if(wks.IsValid()) wks.AddCol("NewColumn");

Keep in mind that Origin 8 supports Workbooks with multiple Worksheets, but the class still works when referencing the proper name:
Worksheet wks("[Book4]Results"); // Sheet named Results in Book4
if(wks.IsValid()) wks.AddCol("Next2");


Go to Top of Page

drew

USA
Posts

Posted - 06/12/2008 :  09:55:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thats great, just summon it back to life.

Thanks!
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