In Origin 8, doc -e w loops over all workbooks instead of worksheets. In addition, %[string], nn returns all letters to the left of the specified character position. So, %[%H,5] returns the first 4 characters.
You can try my script below:
doc -e W { //Loop over all workbooks
for (ii=1; ii<=page.nLayers; ii++) //loop over all layers (worksheets)
{
page.active = ii; //make the worksheet active
%a=page.active$;
if( %[%a,6]=="sheet" ) //choose only those starting with ¡°sheet¡±
{
stats col(d)[1:10]; // This X-Function can take the range directly
type $(stats.sum); // print the result in command window
};
};
}
Deanna
OriginLab Technical Services