Create a new workbook or matrix book
1. newbook name:="ASCII Data";
2. newbook sheet:=0;
3. newbook name:="Experiment1" sheet:=4 hidden:=1;
4. newbook name:="curves" result:=bn$ option:=lsname;
5. newbook mat:=1;
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Desired Book Name | name |
Input string |
|
Specifies the desired name for the workbook. This name can be set to long name only or both long name and short name, depends on the option variable. |
Number of Sheets | sheet |
Input int |
|
Specifies the number of sheets in the workbook. -1 means number of sheets in the template will be used. |
Template | template |
Input string |
|
Specifies the template to use. |
Actual Book Name | result |
Output string |
|
Specifies the string to store the short name of the created workbook. |
Create as Hidden | hidden |
Input int |
|
Specifies whether or not the new workbook should be hidden after it is created (see String Register, %@N). |
Name Option | option |
Input int |
|
Specifies how to set the long name and short name of the workbook with the name variable.
|
New Matrix Book | mat |
Input int |
|
Option of matrix book or workbook. |
Keep Sheet Name | keep |
Input int |
|
Specifies whether or not keep the sheet name in template. If no, default enumeration will be used. |
Do not Create if Found | chkname |
Input int |
|
Check the name; do not create this newbook if it already exists. Setting chkname:=0 will create newbook and enumerate (i.e. newbook1, newbook2, etc.). |
The newbook function creates a new workbook or matrix book. You can specify the number of sheets in the book, the book name and whether the workbook should be hidden. Note: If you have set the option variable to Long and Short name and specified a book name that coincides with the short name of an existing book, this X-Function will not create a new book, because two books cannot have the same short name.
// newbook is used when you need to create a new Workbook. // Begin with a new, empty folder pe_mkdir Example; pe_cd Example; // Repeat three times loop(ii,1,3) { // We only want one 'Results' workbook if( !exist(Results) ) { // Based on ORIGIN.OTW newbook name:=Results template:=origin sheet:=2 option:=1; // We name the Sheets layer1.name$ = QC; layer2.name$ = Standard; } // These names will enumerate newbook name:=Run option:=0 result:=bkname$ template:=bin chkname:=0; } win -s T; //Tile the windows horizontally