Activities based on the serialization of the Excel files. This means they don not use the Excel Application. Therefore, they can run on Windows and Mac without specific requirements.
Open Workbook (From File) |
Open a workbook referenced by a workbook path. Once opened, use the Activate Workbook activity to continue using the workbook.
Technical Name |
Type |
Minimal Agent Version |
openExistingWorkbook |
synchronous
|
WIN-3.10, MAC-3.17
|
Input Parameters:
Name |
Type |
Attributes |
Default |
Description |
workbookPath |
string |
mandatory
|
|
Path of the Workbook to Open |
Sample Code:
//Open a specific workbook irpa_excel.withoutExcel.openExistingWorkbook('C:\myFolder\mySubFolder\myFile.xlsx');
Note:
After opening the workbook, explicitly selecting a worksheet to work on is mandatory
Errors:
Error Class |
Package |
Description |
NotFound |
irpa_core |
File could not be found. |
NotSupported |
irpa_core |
File specification not supported (password...). |
Activate Worksheet (from File) |
Set the ACTIVE worksheet of the ACTIVE workbook. Once activated, further operations such as Get Values or Set Values might be possible. An active workbook must be defined.
Technical Name |
Type |
Minimal Agent Version |
activateWorksheet |
synchronous
|
WIN-3.10, MAC-3.17
|
Input Parameters:
Name |
Type |
Attributes |
Default |
Description |
worksheetName |
string |
mandatory
|
|
Name of the Worksheet to Activate |
Sample Code:
//Activate a worksheet to use to work from the serialization of the Excel file. irpa_excel.withoutExcel.activateWorksheet('myWorksheetName');
Note:
worksheetName is case sensitive.
Errors:
Error Class |
Package |
Description |
SequenceError |
irpa_core |
Have you forgotten to open or create a workbook ? |
NotFound |
irpa_core |
The worksheet has not been found. Verify the worksheetName or check if a worksheet is existing in the workook. |
Return (read) the values of a specified cell range in the ACTIVE worksheet.
Technical Name |
Type |
Minimal Agent Version |
getValues |
synchronous
|
WIN-3.10, MAC-3.17
|
Input Parameters:
Name |
Type |
Attributes |
Default |
Description |
rangeDefinition |
string |
mandatory
|
|
The range definition, for example 'A1:I8'. |
defaultValue |
any |
optional
|
|
Default value with which to fill the empty cells |
getFormat |
irpa_excel.enums.getFormat |
optional
|
standard |
Select the format of the output |
dateFormat |
irpa_excel.enums.dateFormats |
optional
|
object |
Format returned for date cells. The default object is a JavaScript object for describing a date. The ISO string is a string such as yyyy-mm-ddT00.00.000Z. The local date string can be in format dd/mm/yyyy, depending on the local format. |
Output Parameters:
Name |
Type |
Description |
returnedValues |
any |
Values of the range given in the parameters |
Sample Code:
const rangeValues = irpa_excel.withoutExcel.getValues("A1:I8", '');
Sample Code:
const rangeValues = irpa_excel.withoutExcel.getValues("A1:A8", null, enums.getFormat.reduceToList);
Note:
If getFormat is set to 'reduceToList', if the required range is a range with a unique column, or a unique row, the returnedValues will be returned as a list (instead of a list of list). Note as well that an empty cell will correspond to an undefined value in the result list.
Note:
If the rangeDefinition corresponds to a unique cell, the returned value is a unique value (the result is not a list or a list of list).
Errors:
Error Class |
Package |
Description |
SequenceError |
irpa_core |
Have you forgotten to open or create a workbook ? Do you have an active worksheet in the active workbook ? |
Set (write) the values of a specified cells range in the ACTIVE worksheet.
Technical Name |
Type |
Minimal Agent Version |
setValues |
synchronous
|
WIN-3.10, MAC-3.17
|
Input Parameters:
Name |
Type |
Attributes |
Default |
Description |
rangeDefinition |
string |
mandatory
|
|
The definition of the range of cells. Specify a single start cell to use the listDirection parameter. |
values |
any |
mandatory
|
|
The values to write |
listDirection |
irpa_excel.enums.listDirection |
optional
|
vertical |
Define how a single list will be written on the worksheet if the "rangeDefinition" parameter is just set to one cell. |
Sample Code:
// Set values on an exact range irpa_excel.withoutExcel.setValues("A1:D3", [[1, 2, 3, 4], [5, 6, 7, 8], ['nine', 'ten', 'eleven', 'twelve']]);
Sample Code:
// Set single value in a cell irpa_excel.withoutExcel.setValues('A1', 4);
Sample Code:
// Set values on a single row irpa_excel.withoutExcel.setValues("A1", [1, 2, 3, 4, 5, 6, 7, 8, 'nine', 'ten', 'eleven', 'twelve'], enums.listDirection.horizontal);
Sample Code:
// Set values on a single column irpa_excel.withoutExcel.setValues("A1:A12", [[1], [2], [3], [4], [5], [6], [7], [8], ['nine'], ['ten'], ['eleven'], ['twelve']]); irpa_excel.withoutExcel.setValues("A1", [1, 2, 3, 4, 5, 6, 7, 8, 'nine', 'ten', 'eleven', 'twelve'], enums.listDirection.vertical);
Note:
To Set a Date value, you need to provide a javascript date object (it will be considered as UTC), or 'YYYY-MM-DD'.
Errors:
Error Class |
Package |
Description |
SequenceError |
irpa_core |
Have you forgotten to open or create a workbook ? Do you have an active worksheet in the active workbook ? |