Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
Yongbin
Posted - 11/11/2016 : 1:05:42 PM Origin Ver. and Service Release (Select Help-->About Origin): Operating System: Windows 7 Origin Ver. and Service Release (Select Help-->About Origin): Operating System: windows 7
Hi all,
When using doc -e W to loop all the workbooks, what is the looping sequence? Is there any way to modify this? Seems that it follows the workbooks' creation time but sometimes they are different.
For example, I have A B C D four workbooks. When I use doc -e, sometimes it goes like A B C D, sometimes A C D B. The sequence really matters to me and I'm wondering if there is any way I can make sure it follows A B C D.
Any help would be appreciated.
3 L A T E S T R E P L I E S (Newest First)
Yongbin
Posted - 11/14/2016 : 5:56:18 PM Ah, I see. Finally figured it out. Thanks, Yuki!
The way Alexei suggested is even better. Thanks a lot.
aplotnikov
Posted - 11/14/2016 : 09:18:46 AM Hi,
you can also use loop over the string array containing workbook names instead.
StringArray saWBNames;
doc -e W {saWBNames.Add(%H)}
saWBNames.Sort();
loop(ii,1,saWBNames.GetSize()) {
win -a %(saWBNames.GetAt(ii)$);
...
}
If you want to loop the workbooks form A to D in turn, you should active the workbook windows like A-B-C-D, and then save the project. You can find that the loop will go like A-B-C-D as you pleased.