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
 same operation for each workbook
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

lyla7779

6 Posts

Posted - 11/28/2014 :  5:56:41 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 8
Operating System: windows xp

Hi to everyone,
I'm totally new to origin and I need a script to apply to every workbook imported in a folder.
I need to do this operation
Col(4)*(-1) for every workbook,
I kept writing this in the 'set column values' for every workbook, but it makes me lose too much time. So, can someone write me a script that works automatically changing the values in each wb?

Thanks

cdrozdowski111

USA
247 Posts

Posted - 11/28/2014 :  8:26:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Give this a try. I only have later versions of Origin, but this should work with Origin 8 as well.

1) Navigate to the folder containing the workbooks of interest.
2) Open the Script Window from the Window main menu.
3) Copy and paste the below code into the Script Window.
4) Highlight the code and press the Return key to run the script.


doc -ef LB // Loop through all individual sheets in all books in the current Project Explorer folder
{
	if (exist(%H, 2) == 0)	// This filters our Matrix sheets that may be in folder.
		continue;		// If the current item in the loop is NOT a worksheet,
					// then continue with the sheet in the folder.

	// Now multiply column 4 by -1
	col(4) = col(4)*(-1); 
}



For more information about looping through items using LabTalk,
see http://www.originlab.com/doc/LabTalk/guide/Looping-Over-objs

Edited by - cdrozdowski111 on 11/28/2014 8:41:06 PM
Go to Top of Page

lyla7779

6 Posts

Posted - 11/29/2014 :  05:16:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you! It worked! You saved me a lot of time.
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