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
 Origin Forum
 How do you obtain wks name?

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
northpig87 Posted - 03/05/2009 : 2:05:56 PM
Origin Ver. and Service Release (Select Help-->About Origin): Pro8 SR4 V8.0951(B951)
Operating System: WINDOWS XP SP2

Hello everyone, first post here

I have an Origin C code that does fit to a series of worksheet. the problem is I need to specify each worksheet's name in column#1 of a seperate worksheet. So i'm wondering if there's an easier way to fill up a worksheet's column with the names of the other worksheets within the folder.

my stupid attempt was renaming my files to 5 10 15 20 etc (simple name) which is easy to fill up a column with their names but I get the following message:

Illegal Worksheet name:
0 Modified to
A0

Illegal Worksheet name:
5 Modified to
A5

><. So a worksheet name cannot be a simple number?

Thank you so much!!!
1   L A T E S T    R E P L I E S    (Newest First)
GZ_MOD Posted - 03/05/2009 : 10:32:33 PM
Hi,

Worksheet name must begin with character, cannot be numeric. So if set worksheet name to 10, will auto change to A10.
By the way, you can try to worksheet page name:
void test_get_name()
{
Worksheet wks = Project.ActiveLayer();
string str = wks.GetPage().GetName();
out_str(str);
}

In Origin can put string to worksheet, so no need set worksheet name to numeric. Please change back worksheet name to string and try the following codes to put page names of other worksheet in this folder to the active worksheet first column.


// put other worksheet names to this active worksheet.
void PutNameToWks()
{	
	Worksheet wks = Project.ActiveLayer(); 
	
	int nCol = 0; // put to first column
	int nRow = 0;
	
	string strName;
	Folder fld = Project.ActiveFolder();
	foreach(PageBase page in fld.Pages) 
    {
    	if(EXIST_WKS == page.GetType())
    	{
        	strName = page.GetName();
        	if( wks.GetPage().GetName() != strName )
        	{
	         	wks.SetCell(nRow, nCol, strName);
	        	nRow++;
	       		printf("%s\n", strName );   
        	}     	
    	}
    }
}



Iris Bai
OriginLab

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