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
 WorkBook. Worksheet management

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
dkudlay Posted - 06/07/2010 : 8:51:59 PM
Origin Ver. and Service Release (Select Help-->About Origin): 8.1
Operating System: XP

Hello, In my application, there will be a lot of worksheets / matrices generated. I am looking for a best way to manage worksheets. One idea I have is to maintain a Book with all worksheets as separate tabs. I am having difficulty finding the methods I need to get this accomplished.
wks.Create() nor okoc_create_workbook() give me ways to Modify Long AND Short names. And I can't find anywhere the name of the template that is used by wks.Create() to use with okoc_create_workbook that would generate similar Workbook as created by default by Origin (With first 3 rows yellow). I also can't seem to find any functions to add and remove the worksheet to a book. Help please.

Summary -
1) - Access and modify Workbook Long and Short names.
2) - Template name to create standard workbook (Workbook, Book doesn't work)
3) - API to Attach and Remove Worksheets to/from Workbook.

Thank you,

Dimitry.
1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 06/08/2010 : 05:20:02 AM
Hi Dimitry,

1)
In the OriginObject class, four methods are provided for accessing and modifying Workbook Long and Short names. They are GetName, GetLongName, SetName and SetLongName.

2)
The default template name is "Origin". If no changes have been done on this default template, the following code can be used to create a new workbook by using "Origin" template.

void testCreate()
{
	WorksheetPage wp;
	wp.Create("Origin");
}

You can refer to Create method for more information.

3)
Every worksheet has its own workbook, if you want to "attach" one worksheet to another workbook, you can use the AddLayer method to add the current worksheet to another workbook, and then use the Destroy method to remove the current worksheet. For example:

void testAddLayer()
{
	Worksheet wks = Project.ActiveLayer();  // get the active worksheet
	WorksheetPage wp; 
	wp.Create("Origin");  // create a new workbook
	wp.AddLayer(wks);  // add the active worksheet to the newly created workbook
	wks.Destroy();  // destroy the active worksheet
}


Penn

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