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.
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");