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
 Rename a workbook layer
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Rodolf

Netherlands
5 Posts

Posted - 12/08/2008 :  10:10:40 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and SR (Select Help-->About Origin): 8.0773
Operating System: Windows

Hi all,

How do you rename a workbook layer?

I know you can rename de window short name with

wkspage.Rename("Short name");

and the long name with

wkspage.Label= "Label name";

I would like to change the name of a layer i.e. what you can retrieve with

wks.GetName(_certain_string_variable_to_store_name_in_);

Thanks in advance

rlewis

Canada
253 Posts

Posted - 12/08/2008 :  1:18:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Try something like ..

 void RenameWKS()
      {
      	WorksheetPage wP=Project.Pages(-1);
      	Worksheet Wks =wP.Layers(0);
      	if(Wks.IsValid()==true)
      	{
      		Wks.SetName("NewName");
      	}
      }
Go to Top of Page

Rodolf

Netherlands
5 Posts

Posted - 12/09/2008 :  03:45:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, worked like a charm.

I couldn't find it in the documentation, because I did not search the class tree at the OriginObject level, only to the Layer and PageBase level.

It would be nice if the people at OriginLab would also included all functions inherited from parents when you search the Help file for the contents of a class like Worksheet or WorksheetPage.
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