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
 LabTalk Forum
 Set Comment of all workbooks in Folder X
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Cromatej

Germany
2 Posts

Posted - 12/18/2020 :  09:02:51 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System: Windows 10
OriginPro 2019b (32-bit)
9.6.5.169

Hello,

is there any possibility to set the comment in all workbooks and columns which are in Folder X. I just want to avoid looping over all workbooks and columns and set the comment for each column by itself.

Thank you

Best regards Matej

Chris D

428 Posts

Posted - 12/18/2020 :  11:45:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Perhaps someone knows better but here is the LabTalk to do it though it does require loops.

doc -ef W {
    page.comments$ = "Book Comments";
    int nwks = page.nlayers;
    for (int ii = 1; ii <= nwks; ii++) {
        page.active = ii;
        int ncols = wks.ncols;
        for (int nn = 1; nn <= ncols; nn++) {
            wcol(nn)[C]$ = "Column Comments";
        }
    }
}


Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

Cromatej

Germany
2 Posts

Posted - 12/22/2020 :  5:23:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Chris D

Perhaps someone knows better but here is the LabTalk to do it though it does require loops.

doc -ef W {
    page.comments$ = "Book Comments";
    int nwks = page.nlayers;
    for (int ii = 1; ii <= nwks; ii++) {
        page.active = ii;
        int ncols = wks.ncols;
        for (int nn = 1; nn <= ncols; nn++) {
            wcol(nn)[C]$ = "Column Comments";
        }
    }
}


Thanks,
Chris Drozdowski
Originlab Technical Support




Thank you for your answer. The code does exactly what I want. Just another question...is there any possibility to navigate into a folder named X?

I want that the code is applied in all folders which are listed f.e. in a workbook. (Folder 1, Folder 3, Folder 4,....)

Any ideas for this? Couldn't find a command which navigates into a desired folder.

Thank you Matej
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