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
 folders and worksheets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

nbo10

USA
Posts

Posted - 10/06/2006 :  11:26:17 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: XP

I have a project file that has ~50 folders and each folder has a worksheet and a few graphs. How would I go through each folder find the worksheet and then delete a few data rows from that worksheet? Thanks

Deanna

China
Posts

Posted - 10/07/2006 :  11:20:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi John. The following function examplifies how to delete the tenth row of each worksheet in the subfolders of root. I hope you will find it useful.


void test5172()
{
Folder fldRoot("/");

foreach (Folder sf in fldRoot.Subfolders) //loop over the subfolders of root folder
{
foreach (PageBase pg in sf.Pages) //loop over the pages in the subfolder
{
if (pg.GetType() == EXIST_WKS) //check if the page is an worksheet page
{
WorksheetPage wp(pg);
Worksheet wks(wp.Layers(0));
wks.DeleteRow(10); //delete the 10th row
}
}

}

}


Deanna
OriginLab Technical Services
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