SAP Help Home SAP Intelligent RPA Help Portal SAP Intelligent RPA Community

Module - Without Excel Application

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.

Activities

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.


Get Values (from File)

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 Values (from File)

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 ?


Get Worksheet Name (from File)

Retrieve the name of the worksheet in the workbook.


Technical Name Type Minimal Agent Version
getWorksheetsName synchronous WIN-3.10, MAC-3.17

Output Parameters:

Name Type Description
worksheetNames Array. Name of the worksheets in the workbook.

Sample Code:

irpa_excel.withoutExcel.getWorksheetsName();

Errors:

Error Class Package Description
SequenceError irpa_core Have you forgotten to open or create a workbook ?


Add Worksheet (from File)

Add a new worksheet to the ACTIVE workbook.


Technical Name Type Minimal Agent Version
addNewWorksheet synchronous WIN-3.10, MAC-3.17

Input Parameters:

Name Type Attributes Default Description
worksheetName string mandatory Name of the worksheet to add

Sample Code:

irpa_excel.withoutExcel.addNewWorksheet("Sheet2");



Delete Worksheet (from File)

Delete a worksheet on the ACTIVE workbook.


Technical Name Type Minimal Agent Version
deleteWorksheet synchronous WIN-3.10, MAC-3.17

Input Parameters:

Name Type Attributes Default Description
worksheetName string optional The name of the worksheet to delete. If not filled, the active worksheet will be deleted.

Sample Code:

irpa_excel.withoutExcel.deleteWorksheet("Sheet1");

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 ?
NotFound irpa_core The worksheet has not been found. Verify the worksheetName or check if a worksheet is existing in the workook.


Rename Worksheet (from File)

Rename a worksheet on the ACTIVE workbook.


Technical Name Type Minimal Agent Version
renameWorksheet synchronous WIN-3.10, MAC-3.17

Input Parameters:

Name Type Attributes Default Description
newWorksheetName string mandatory The worksheet name to rename.

Sample Code:

irpa_excel.withoutExcel.renameWorksheet("NewSheet");

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 ?
NotFound irpa_core The worksheet has not been found. Verify the worksheetName or check if a worksheet is existing in the workook.


Get Active Worksheet Name (from File)

Get the name of the active worksheet.


Technical Name Type Minimal Agent Version
getActiveWorksheetName synchronous WIN-3.10, MAC-3.17

Output Parameters:

Name Type Description
activeSheetName string Name of the active worksheet.

Sample Code:

irpa_excel.withoutExcel.getActiveWorksheetName();

Errors:

Error Class Package Description
SequenceError irpa_core Do you have an active worksheet in the active workbook ?


Save Workbook (from File)

Save the active workbook.


Technical Name Type Minimal Agent Version
save synchronous WIN-3.10, MAC-3.17

Sample Code:

irpa_excel.withoutExcel.save();

Errors:

Error Class Package Description
SequenceError irpa_core Have you forgotten to open or create a workbook ?


Save As Workbook (from File)

"Save As" the active workbook.


Technical Name Type Minimal Agent Version
saveAs synchronous WIN-3.10, MAC-3.17

Input Parameters:

Name Type Attributes Default Description
filePath string mandatory Full path corresponding to the new location of the workbook.

Sample Code:

irpa_excel.withoutExcel.saveAs('C:\myFolder\mySubFolder\myFile.xlsx');

Errors:

Error Class Package Description
SequenceError irpa_core Have you forgotten to open or create a workbook ?


Add Workbook (from File)

Create an empty workbook with an empty worksheet. 'Sheet1 as the active workbook.


Technical Name Type Minimal Agent Version
addNewWorkbook synchronous WIN-3.10, MAC-3.17

Sample Code:

irpa_excel.withoutExcel.addNewWorkbook();



Close Workbook (from File)

Close the active workbook


Technical Name Type Minimal Agent Version
close synchronous WIN-3.10, MAC-3.17

Input Parameters:

Name Type Attributes Default Description
hasToSave boolean optional false Set to true to save the workbook before closing it. Set to false for not saving it.

Sample Code:

irpa_excel.withoutExcel.close();

Errors:

Error Class Package Description
SequenceError irpa_core Have you forgotten to open or create a workbook ?