EmailWorksheet macro
Parameter | Description |
---|---|
Export Type | The format of file in which the worksheet is to be sent. Possible options:
|
Worksheet Name | The name of the worksheet to execute and email. |
User | The email recipient for the worksheet. Note: The user must have access to the
worksheet.
|
Item Passed | The item selection passed to the worksheet. This value can be a single element
or set of elements. Note:
|
Location Passed | The location selection passed to the worksheet. This value can be a single
element or set of elements. Note:
|
Period Passed | The period selection passed to the worksheet. This value can be a single
element or set of elements. Note:
|
Requirement | Parameters |
---|---|
Execute Demand Margin Analysis worksheet with default item, location and period selection from worksheet definition and email the PDF output to user ‘Scott’. |
EmailWorksheet("PDF","Demand Margin Analysis","Scott"). EmailWorksheet("PDF","Demand Margin Analysis","Scott","","",""). |
Execute Demand Essentials worksheet with default item, location and period selection from worksheet definition and email the XLS output to user ‘Harry’. | EmailWorksheet("XLS","Demand Essentials","Harry","","",""). |
Execute Forecast Accuracy Analysis worksheet with Brand A item node, default location selection and Rolling Weeks period node and email the PDF output to user ‘Harry’. | EmailWorksheet("PDF","Forecast Accuracy Analysis","Harry","Brand A","","Rolling Weeks"). |
Validation and Execution
On successful validation and execution of the macro, the worksheet is loaded with the selected item, location and period and emailed to the specified user. These are the validation rules:
- If the macro parameters are Null, the default value specified in worksheet for item, location and period selections are used.
- If the macro parameters and the worksheet default parameters for item, location and period are Null, the top node selections of item, location and period are used.
Validation and error messages
Cycle Period Status | Scenario status | Can Execute? | Validation message |
---|---|---|---|
Pending | N/A | No | Cannot run macro {0} because Cycle Period has status "Pending". |
Running | Any | Yes | N/A |
Paused | Any | No | Cannot run macro {0} because Cycle Period has status "Paused" |
Completed | Any | Yes | N/A |
Aborted | Any | Yes | N/A |
Archived | Any | No | Cannot run macro {0} because Cycle Period has status "Archived”. |
Validation Condition | Error Message |
---|---|
Ensure that the worksheet is valid for the current user and module. | worksheet {0} is not enabled for module {1} or user {2}. |
Adding a worksheet screen capture is only supported for standard
worksheets. Multi-panel worksheets are not yet supported. |
Invalid parameter value {0}. Worksheet is not of Type = Standard. |
Ensure that the export type corresponds to the available formats. | Invalid parameter value {0}. Export type must be PDF or XLS. |
Ensure that the specified user is valid and has a valid email address. | user {0} cannot be found. |
Ensure that the specified user has access rights to the required worksheet. | User {0} does not have access rights to worksheet {1} |
If specified, ensure that the item nodes are valid. | item {0} cannot be found. |
If specified, ensure the location nodes are valid. | location {0} cannot be found. |
If specified, ensure the period nodes are valid. | period label {0} cannot be found. |
If specified, ensure that the values for item nodes can be evaluated. For some cases, the worksheet parameter, rv_item_passed cannot be used to initialize the macro parameter. |
Item Passed cannot be evaluated. Define an alternate selection. |
If specified, ensure that the values for location nodes can be evaluated.
For some cases, the worksheet parameter, rv_location_passed cannot be used to initialize the macro parameter. |
Location Passed cannot be evaluated. Define an alternate selection. |
If specified, ensure that the values specified for period nodes can be
evaluated. For some cases, the worksheet parameter, rv_period_passed cannot be used to initialize the macro parameter. |
Period Passed cannot be evaluated. Define an alternate selection. |