Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
transformations:excelcommand [2021/11/26 20:57] – [See also] Linki to Community article craigt | transformations:excelcommand [2022/01/31 14:25] – Add in "File already exists table" craigt |
---|
* Delete sheet | * Delete sheet |
* Recalculate workbook | * Recalculate workbook |
| * Re-save |
| * Save as PDF |
| |
\\ | \\ |
|Command|Select the command to run on the selected Excel file. Options: //List sheets/ranges//, //Run VBA macro//, //Rename sheet//, //Delete sheet//, or //Recalculate workbook//. See below for details of each command.| | |Command|Select the command to run on the selected Excel file. Options: //List sheets/ranges//, //Run VBA macro//, //Rename sheet//, //Delete sheet//, or //Recalculate workbook//. See below for details of each command.| |
| |
<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].\\ | <sup>*</sup> Setting can be specified using a [[:parameters|parameter]] or the first value of a column.\\ |
| |
\\ | \\ |
|Macro arguments<sup>*</sup>|If the macro being run accepts arguments, the values to be passed in are listed here. Arguments should be\\ listed in the order the macro is expecting them.| | |Macro arguments<sup>*</sup>|If the macro being run accepts arguments, the values to be passed in are listed here. Arguments should be\\ listed in the order the macro is expecting them.| |
| |
<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].\\ | <sup>*</sup> Setting can be specified using a [[:parameters|parameter]] or the first value of a column.\\ |
| |
\\ | \\ |
|New name<sup>*</sup>|Enter the name the selected sheet will be changed to.| | |New name<sup>*</sup>|Enter the name the selected sheet will be changed to.| |
| |
<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].\\ | <sup>*</sup> Setting can be specified using a [[:parameters|parameter]] or the first value of a column.\\ |
| |
\\ | \\ |
|Sheet name<sup>*</sup>|Select the existing sheet in the Excel file to be deleted.| | |Sheet name<sup>*</sup>|Select the existing sheet in the Excel file to be deleted.| |
| |
<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].\\ | <sup>*</sup> Setting can be specified using a [[:parameters|parameter]] or the first value of a column.\\ |
| |
\\ | \\ |
This mode has no settings. | This mode has no settings. |
| |
| \\ |
| ====Re-save settings==== |
| Description: Forces a re-saving of the .xlsx workbook to correct possible format problems introduced programmatically by 3rd-party utilities/libraries.\\ |
| This mode has no settings. |
| |
| \\ |
| ====Save as PDF settings==== |
| Description: Generates a PDF file from the selected sheets in an Excel workbook. |
| ^Setting^ Description ^ |
| |PDF file<sup>*</sup>|Enter the fully qualified path and filename of the PDF file to be generated.| |
| |If the PDF file already exists|Refer to the //File already exists options// table below for details.| |
| |Page range|Choose which pages to include in the PDF file. Options: //All pages// (all pages in the select sheet will be exported to the PDF file), or //Pages// (and enter the starting and ending number of the pages to be exported).| |
| |Sheets|Choose which workbook sheets will be exported to the PDF file. Options: //All sheets// (the content from all worksheets will be exported), or //Selected sheets// (select the sheets to include from the list).| |
| |
| <sup>*</sup> Setting can be specified using a [[:parameters|parameter]] or the first value of a column.\\ |
| |
| \\ |
| ====File already exists options==== |
| ^Option ^Description ^ |
| |Overwrite|The new file replaces the original file.| |
| |Rename|The original file will be renamed with "backup" and a serial number appended to the file name. The new file will\\ possess the name specified in the //File// setting.| |
| |Halt project execution|The project will stop processing and this action will display a warning symbol.| |
\\ | \\ |
=====Remarks===== | =====Remarks===== |
When running a macro that alters the macro's own file, do not include a //Workbook.Close// statement at the end of the subroutine. Doing so will generate an error as EasyMorph holds the Excel file open. Remove the statement and allow EasyMorph to close the file. If using a //Workbook.Close True// statement to both save and close the workbook, use a //Workbook.Save// statement instead. | When running a macro that alters the macro's own file, do not include a //Workbook.Close// statement at the end of the subroutine. Doing so will generate an error as EasyMorph holds the Excel file open. Remove the statement and allow EasyMorph to close the file. If using a //Workbook.Close True// statement to both save and close the workbook, use a //Workbook.Save// statement instead. |
| |
When capturing a return value from a function macro, the output dataset of the action will be the captured value. If the return value is an array, each value will be split into its own row. | When capturing a return value from a function macro, the output dataset of the action will be the captured value. If the return value is an array, each value will be split into its own row.\\ |
| \\ |
| ===Save to PDF=== |
| This mode triggers the "Export to PDF" process within Excel which uses the "Microsoft Print to PDF" printer to format the pages. Pre-select this printer in Excel prior to laying out the pages to be printed to ensure margins and spacing are accurate in the resulting PDF files. |
| |
| |