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
 number of sheets in a book!
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

misrapr

India
Posts

Posted - 12/26/2007 :  08:03:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 8 Pro
Operating System: Win XP Pro


How to find the number of sheets present in a workbook and get their names ??

cpyang

USA
1406 Posts

Posted - 12/26/2007 :  10:03:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
A. From LT
1. page.nlayers, as a book is a page and each sheet is a layer.
2. wks.name$, but better use range, see below:



loop(i,1,page.nlayers) {
range ss=$(i)!;
ss.name$=;
}



B. from OC, idea is the same


WorksheetPage wp = Project.Pages();
foreach(Layer lay in wp.Layers)
{
Worksheet wks = lay;
printf("sheet name is %s\n", wks.GetName());
}





Go to Top of Page

misrapr

India
Posts

Posted - 01/03/2008 :  01:32:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Cpyang !!

that worked like a charm ....
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