PALATINELABSDocsENES

Pages

↑↓ to moveEnter to openEsc to close

Excel package guide

Read and change workbooks through a named session. Use Basic for direct .xlsx file work, or Advanced for Microsoft Excel.

Packages. Version 2.17.1. Installed versions can differ. Examples are illustrative and not tested.

Jump to actions

Prerequisites

Basic reads an .xlsx file directly; Advanced uses a desktop spreadsheet application.
Basic and Advanced modes.

For the shared example, prepare samples/report.xlsx with worksheet Data: A1=Name, B1=Amount, A2=Ana, B2=12, A3=Ben, B3=7. Open it with containsHeader=true, isSpecificSheet=true and sheetName=Data.

For table actions, create an Excel table named Sales over Data!A1:B3 in a test copy of the workbook before the Run. A Table variable is different: fill it with Get multiple cells or Get worksheet as data table, then use it as $rows$.

Shared fields

Fields with a link follow these rules. A field is optional unless it says Required. Type/default shows the type, then the default after ;. An empty Credential has an empty username and password. Bind each output to a variable of the listed type.

Rule (fields)Meaning
Sheet selection (sheetOption)BYNAME selects the worksheet by its exact name. BYINDEX selects it by position, starting at 1. In an Advanced session opened with excludeHiddenSheets=true⁠, the index counts only visible sheets, unless the action says otherwise. Choices: BYINDEX (Index), BYNAME (Name).
Source workbook (fromWorkBookPath⁠, filePath)Path of an existing workbook, for example samples/source.xlsx⁠. Relative paths start from the working folder. The action opens the source read-only and closes it without saving.
Mode (mode)Basic reads and writes .xlsx files without Microsoft Excel. Advanced controls Microsoft Excel on Windows. Choose the mode when you open or create the session. Choices: Basic (Basic (the file itself, no Excel needed)), Advanced (Advanced (Microsoft Excel)).
Overwrite (isOverwrite)true lets the action replace the target file. false fails if the target exists.
Apply sensitivity (setSensitivity)true applies the Microsoft Purview label after the workbook opens or is created. This needs Microsoft 365 Excel with label support.
Sensitivity ID (sensitivityId⁠, labelId)A Credential variable whose password holds the Purview label ID. The username is ignored. Get the ID from your label administrator.
Sensitivity errors (continue_on_error_set_Sensitivity)false⁠: the step fails if the label cannot be set. true⁠: the step continues, also for an empty or wrong label ID, but the label may not be set.
Cell address (cell⁠, cellAddress)One A1 address, such as B2⁠. For $B$2⁠, type $$B$$2 or use a String variable that holds $B$2⁠. Empty uses the active cell, except in Go to cell, which needs an address.
Excel table name (tableName)Name of an existing Excel table, for example Sales⁠. This is a table in the workbook, not a Table variable. The search covers all worksheets and ignores case.
Column header (columnName)The header text, for example Amount⁠. The action looks in the first row of the selected range and ignores case.
Column position (columnNumber)Column position in the selected table or range, starting at 1. 1 is its first column, which need not be worksheet column A.
From / Till (from⁠, till)The two corners of the area, both included. BEGINNING is the top-left used cell, END the bottom-right used cell, ACTIVECELL the active cell, and SPECIFICCELL the address you give. The order of the corners does not matter. Choices: BEGINNING (Beginning), END (End), ACTIVECELL (Active cell), SPECIFICCELL (Specific cell).
Search text (findText)Literal text to find, not empty, for example cat⁠. It is not a regular expression. The search reads the stored cell values.
Scan order (searchOptions)BYROWS scans left to right, then down. BYCOLUMNS scans top to bottom, then right. Choices: BYROWS (By rows), BYCOLUMNS (By columns).
Search start (startFromActiveCell)true starts at the active cell. false starts at cellAddress⁠; an empty address also uses the active cell. The search includes the start cell.
Read option (readOption)READ_CELL_TEXT reads the displayed text in Advanced. READ_CELL_VALUE reads the stored value, such as 12.5⁠. Basic returns the stored value for both choices. An empty cell returns an empty String. Choices: READ_CELL_TEXT (Read visible text in cell), READ_CELL_VALUE (Read cell value).
Worksheet selection (sheetSelection)ActiveWorksheet uses the active sheet. SpecificSheet uses fromSpecificSheet⁠; an empty name also uses the active sheet. Choices: ActiveWorksheet (Active worksheet), SpecificSheet (Specific worksheet).
Row span (rowsRange)Required. A row or row span, for example 3 or 2:5⁠. All cells in those rows are affected.
Column span (colsRange)Required. A column letter or span, for example B or B:D⁠. All cells in those columns are affected.
Password (password and the other Credential password fields)A Credential variable with the password, for example $workbookPassword$⁠. Only its password is used. Empty means no password.
Existing sheet index (sheetIndex)A whole number from 1 that identifies an existing worksheet.
Existing sheet name (sheetName)The name of an existing worksheet, for example Data⁠.
Active cell (activeCell⁠, cellOption)true uses the active cell. false uses the cell address; an empty address also uses the active cell.

Common inputs

These inputs mean the same in every action that names them. Each action says which ones it uses.

IDEditor fieldType/defaultRequirement/use
sessionSession nameString⁠; emptyUse the same session name in later steps, such as report⁠. It identifies the workbook and holds no password.
activeCellUse the active cellBoolean⁠; falseActive cell.
cellCell addressString⁠; emptyCell address. When activeCell=false⁠.
cellAddressCell addressString⁠; emptyCell address. When activeCell=false⁠.
readOptionRead optionReadOption⁠; READ_CELL_TEXTRead option.
sheetIndexSheet indexNumber⁠; 1Existing sheet index. When sheetOption=BYINDEX⁠.
sheetNameSheet nameString⁠; emptyExisting sheet name. When sheetOption=BYNAME⁠.

Actions

Each action works in Basic and Advanced, unless it says Advanced required.

Switch to sheet (excelActivateSheet)

Activate a worksheet for cell operations. Basic also resets the active cell to A1.

Inputs

IDEditor fieldType/defaultRequirement/use
sheetOptionActivate sheet bySheetOption⁠; BYNAMESheet selection.

Also uses session, sheetIndex and sheetName from the common inputs.

Outputs

None.

Example

Open a workbook with worksheets Data and Archive. Set sheetName=Archive.

Expected result

Get current worksheet name returns Archive. A missing name or out-of-range index fails the step.

Back to actions

Append workbook (excelAppendWorkbook)

Append copies of all source worksheets. The source stays unchanged.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
fromWorkBookPathAppend from workbookString⁠; emptyRequired. Source workbook.
isSecurePassword is requiredBoolean⁠; falseSet true only for a workbook that needs an opening password. Basic Open rejects this option.
secureToReadTo openCredential⁠; emptyPassword to open the workbook. When isSecure=true⁠.

Also uses session from the common inputs.

Outputs

None.

Example

Prepare samples/source.xlsx with sheets January and February. Set fromWorkBookPath=samples/source.xlsx.

Expected result

Copies of both source sheets follow the existing sheets. Excel may change copied names if they conflict. An unreadable file or incorrect password fails the step. Save the destination to keep the copies.

Back to actions

Append worksheet (excelAppendWorksheet)

Append a source worksheet selected by name or position.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
filePathAppend from workbookString⁠; emptyRequired. Source workbook.
isSecurePassword is requiredBoolean⁠; falseSet true only for a workbook that needs an opening password. Basic Open rejects this option.
passwordToOpenTo openCredential⁠; emptyPassword to open the workbook. When isSecure=true⁠.
sheetOptionWorksheet to be appended bySheetOption⁠; BYNAMESheet selection.
sheetNameWorksheet nameString⁠; emptyExisting sheet name. When sheetOption=BYNAME⁠.
sheetIndexWorksheet indexNumber⁠; 1The source worksheet position from 1⁠. All source worksheets count, including hidden sheets. When sheetOption=BYINDEX⁠.

Also uses session from the common inputs.

Outputs

None.

Example

Prepare samples/source.xlsx with worksheet January. Set filePath=samples/source.xlsx, sheetName=January.

Expected result

A copy of January becomes the final worksheet. Source indexes count all source worksheets, even when the destination session excludes hidden sheets. A missing sheet fails.

Back to actions

Close (excelCloseSpreadsheet)

Close the session, releasing its file and Advanced Excel process. Choose whether to save first.

Inputs

IDEditor fieldType/defaultRequirement/use
isSaveSave changes when closing fileBoolean⁠; falsetrue saves before closing. false closes without saving and discards pending changes.
isDisplayErrorEnabledReport an error when the file is read-onlyBoolean⁠; falseAdvanced mode: true fails when save was requested on a read-only session; false skips saving and closes. Basic mode rejects closing with save on a read-only session for either value. When isSave=true⁠.

Also uses session from the common inputs.

Outputs

None.

Example

After changing B2 in the test workbook, set isSave=true.

Expected result

The workbook is saved and the session is removed. Later actions on report fail until it is opened again. With isSave=false, unsaved changes are discarded. If saving raises an error, closure is not reached.

Back to actions

Convert excel to PDF (excelConvertToPDF)

Export a workbook or selected worksheet to a PDF. Excel supplies the page layout and print settings.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
convertSheetTypeSelect sheet(s) to be convertedConvertSheetType⁠; ENTIRE_EXCELENTIRE_EXCEL exports the workbook; ACTIVE_SHEET the active worksheet; SPECIFIC_SHEET the named worksheet. Choices: ENTIRE_EXCEL (Entire excel file), ACTIVE_SHEET (Active sheet), SPECIFIC_SHEET (Specific sheet).
sheetNameSheet nameString⁠; emptyExisting sheet name. When convertSheetType=SPECIFIC_SHEET⁠.
fileStorageLocationSelect PDF storage locationString⁠; emptyRequired. The destination folder, for example samples/export⁠. Relative paths use the automation working folder. Missing folders are created.
pdfFileNameSpecify PDF file nameString⁠; emptyRequired. A non-empty file name, for example report or report.pdf⁠. The action adds .pdf when needed.
overwriteFileIf a PDF with the same name already existsOverwriteFile⁠; OVERWRITEOVERWRITE replaces an existing target PDF. DONT_OVERWRITE uses the first available numbered name, starting with (2)⁠. Choices: OVERWRITE (Overwrite existing file), DONT_OVERWRITE (Don't overwrite (save as Filename (2))).

Also uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultStringThe full PDF path actually written. Editor: Assign the PDF path to.

Example

Use sheet Data. Set convertSheetType=SPECIFIC_SHEET, sheetName=Data, fileStorageLocation=samples/export, pdfFileName=report, overwriteFile=DONT_OVERWRITE. Bind result to pdfPath.

Expected result

Excel creates report.pdf in the resolved export folder. If it exists, the first free name is report (2).pdf, then (3), and so on. Export or filesystem errors fail the step.

Back to actions

Create workbook (excelCreateSpreadsheet)

Create and save a report workbook, keeping it open as a named session.

Inputs

IDEditor fieldType/defaultRequirement/use
modeModeExcelMode⁠; BasicMode.
filePathFile pathString⁠; emptyRequired. The new workbook path, for example samples/report.xlsx⁠. Basic uses .xlsx⁠; Advanced chooses the Excel file format from the extension. Missing parent folders are created.
isOverwriteOverwrite existing fileBoolean⁠; falseOverwrite.
sheetNameSheet nameString⁠; emptyThe first worksheet name, for example Data⁠. Empty creates the default first sheet (Sheet1 in Basic mode).
passwordToOpenPassword to openCredential⁠; emptyPassword to open the workbook. When mode=Advanced⁠.
passwordToEditPassword to editCredential⁠; emptyPassword to change the workbook. When mode=Advanced⁠.
setSensitivitySet sensitivity labelBoolean⁠; falseApply sensitivity. When mode=Advanced⁠.
sensitivityIdSensitivity labelCredential⁠; emptySensitivity ID. When mode=Advanced and setSensitivity=true⁠.
continue_on_error_set_SensitivityContinue on errorBoolean⁠; falseSensitivity errors. When mode=Advanced and setSensitivity=true⁠.

Also uses session from the common inputs.

Outputs

IDTypeMeaning/binding
sessionNameStringString equal to the supplied session name. Bind it if later steps need the name through a variable. Editor: Create Excel session.

Example

Set filePath=samples/report.xlsx, sheetName=Data. Bind sessionName to openedSession.

Expected result

A saved workbook with worksheet Data is created. $openedSession$ is report. The action creates missing parent folders. Basic rejects non-empty opening or editing passwords; use Advanced for password protection. An existing file fails unless overwrite is enabled; enabling it replaces that file.

Back to actions

Create worksheet (excelCreateWorksheet)

Add and activate a worksheet by name or position.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
sheetOptionCreate sheet bySheetOption⁠; BYNAMESheet selection.
sheetIndexSheet indexNumber⁠; 1The position, starting at 1, of an existing worksheet to insert before. A value outside the range adds the sheet at the end. This index counts all worksheets. When sheetOption=BYINDEX⁠.
sheetNameSheet nameString⁠; emptyThe new, unique Excel worksheet name. It is required with BYNAME⁠; it does not name an existing sheet. When sheetOption=BYNAME⁠.

Also uses session from the common inputs.

Outputs

None.

Example

Set sheetName=Archive in a workbook with no Archive sheet.

Expected result

A worksheet named Archive is added after the final worksheet. A duplicate or invalid worksheet name fails. With a valid existing index, the new unnamed sheet is inserted before that index; an index outside the existing range appends it.

Back to actions

Delete cells (excelDeleteCells)

Delete a cell with a shift, or its entire row/column.

Inputs

IDEditor fieldType/defaultRequirement/use
deleteOptionDelete optionsDeleteOption⁠; ShiftCellsLeftShiftCellsLeft moves following cells left; ShiftCellsUp moves cells below upward; EntireRow deletes the full row; EntireColumn deletes the full column. Choices: ShiftCellsLeft (Shift cells left), ShiftCellsUp (Shift cells up), EntireRow (Entire row), EntireColumn (Entire column).

Also uses session, activeCell and cell from the common inputs.

Outputs

None.

Example

In a test sheet, put a in A1 and b in B1. Set cell=A1.

Expected result

A1 now contains b. The original a is deleted. Whole-row or whole-column choices delete every cell in that row or column. A read-only session rejects the action.

Back to actions

Delete worksheet (excelDeleteSpreadsheet)

Delete a worksheet without confirmation because Excel alerts are disabled.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
sheetOptionDelete sheet bySheetOption⁠; BYNAMESheet selection.

Also uses session, sheetIndex and sheetName from the common inputs.

Outputs

None.

Example

Use a test workbook with Data and Temporary. Set sheetName=Temporary.

Expected result

Temporary and its contents are removed. Data remains. Excel rejects deletion that leaves no valid visible worksheet, or deletion blocked by workbook protection.

Back to actions

Delete table column (excelDeleteTableColumn)

Delete a table column and its data, by name or position.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
tableNameTable nameString⁠; emptyRequired. Excel table name.
deleteOptionDelete column byTableColumnBy⁠; COLUMNNAMECOLUMNNAME finds the table column by its header. COLUMNPOSITION uses its position in the table, starting at 1. Choices: COLUMNNAME (Name), COLUMNPOSITION (Position).
columnNameColumn nameString⁠; emptyColumn header. When deleteOption=COLUMNNAME⁠.
columnPositionColumn position (at)Number⁠; 1The position in the table, starting at 1, for example 2 for its second column. When deleteOption=COLUMNPOSITION⁠.

Also uses session from the common inputs.

Outputs

None.

Example

In a test workbook, create table Sales with columns Name, Amount, Temporary. Set tableName=Sales, columnName=Temporary.

Expected result

Sales contains Name and Amount; Temporary and its values are removed. An unknown table or column fails.

Back to actions

Break one or all external workbook links, keeping cell values.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
linksOptionA specific linkBoolean⁠; truetrue breaks only a matching link. false breaks every external Excel workbook link.
specificLinkLinkString⁠; emptyThe full source link returned by Get workbook links, or its file name such as source.xlsx⁠. Matching ignores case. When linksOption=true⁠.

Also uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultNumberCount of source links broken, not the number of affected cells. Editor: Assign the output to variable.

Example

In a test workbook linked to source.xlsx, set specificLink=source.xlsx. Bind result to brokenLinks.

Expected result

With exactly one matching source, brokenLinks is 1. Formulas linked to that source become values. No matching links returns 0; Excel errors still fail the step.

Back to actions

Disable or enable real-time screen update (excelEnableDisableAutoUpdate)

Disable Excel screen redraw during edits; re-enable it afterward.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
enableDisableScreenUpdateOptionReal-time screen updateScreenUpdate⁠; disabledisable sets Excel ScreenUpdating to false. enable sets it to true. Re-enable it after the edit sequence. Choices: disable (Disable), enable (Enable).

Also uses session from the common inputs.

Outputs

None.

Example

Run this action. Make the sample edits, then run it again with enableDisableScreenUpdateOption=enable.

Expected result

Excel stops redrawing during the edit sequence and resumes afterward. This changes screen display, not calculation or workbook saving.

Back to actions

Filter (excelFilterTableV2)

Apply AutoFilter to a table or worksheet range, hiding rows that fail the criterion without deleting them.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
filterOptionFilterFilterOption⁠; FilterTableFilterTable uses the named Excel table. FilterWorksheet uses a specific range or the used area on the chosen worksheet. Choices: FilterTable (Table), FilterWorksheet (Worksheet).
tableNameTable nameString⁠; emptyExcel table name. When filterOption=FilterTable⁠.
worksheetNameWorksheet nameString⁠; emptyA worksheet name, for example Data⁠, or leave empty to use the active sheet. When filterOption=FilterWorksheet⁠.
removeExistingFilterRemove existing filter from the sheetBoolean⁠; falsetrue removes the worksheet AutoFilter before applying this filter. false keeps existing filtering. Only the worksheet branch uses this field. When filterOption=FilterWorksheet⁠.
cellRangeCell rangeCellRangeOption⁠; AllCellsAllCells uses the used area of the worksheet. Specific uses specificCellrange⁠. In both cases the range must include a header row. When filterOption=FilterWorksheet⁠. Choices: AllCells (All cells), Specific (Specific).
specificCellrangeRangeString⁠; emptyThe complete range including headers, for example A1:B20⁠. When filterOption=FilterWorksheet and cellRange=Specific⁠.
columnOptionFilter forFilterColumn⁠; ColumnNameColumnName finds the header in the first row. ColumnNumber uses the position in the filtered range, starting at 1. Choices: ColumnName (Column name), ColumnNumber (Column position).
columnNameColumn nameString⁠; emptyColumn header. When columnOption=ColumnName⁠.
columnNumberColumn positionNumber⁠; 1Column position. When columnOption=ColumnNumber⁠.
filterBasedOnNumberSelectedFilter byFilterKind⁠; NumberNumber uses the numeric comparison choice. Text uses the text comparison choice. Excel interprets the resulting criterion. Choices: Number (Number), Text (Text).
filterBasedOnNumberNumber filterNumberFilter⁠; equalsNumberWhen filterBasedOnNumberSelected=Number⁠. Choices: equalsNumber (Equals, =), notEqualsNumber (Does not equal, <>), greaterThanNumber (Greater than, >), greaterThanEqualsToNumber (Greater than or equal to, >=), lessThanNumber (Less than, <), lessThanEqualsToNumber (Less than or equal to, <=), betweenNumber (Between, includes both value and valueTo).
filterBasedOnTextText filterTextFilter⁠; equalsTextequalsText keeps cells equal to the value and notEqualsText hides them. The begins, ends, contains and not-contains choices match part of the cell. * and ? in the value work as in Excel. When filterBasedOnNumberSelected=Text⁠. Choices: equalsText (Equals), notEqualsText (Does not equal), beginsWithText (Begins with), endsWithText (Ends with), containsText (Contains), notContainsText (Does not contain).
valueValueString⁠; emptyThe comparison value as text, for example 10 for a number filter or Ana for a text filter. For Between it is the lower limit, included.
valueToTo valueString⁠; emptyThe upper limit for betweenNumber⁠, included, for example 20⁠. Other comparisons do not use it. When filterBasedOnNumberSelected=Number and filterBasedOnNumber=betweenNumber⁠.

Also uses session from the common inputs.

Outputs

None.

Example

Create an Excel table Sales over A1:B3 with headers Name, Amount and rows Ana, 12 and Ben, 7. Set tableName=Sales, columnName=Amount, filterBasedOnNumber=greaterThanNumber, value=10.

Expected result

The header and Ana row stay visible. The filter hides the Ben row. With no match, only the header stays visible. A wrong table name, header or range fails. Filters on other columns still apply.

Back to actions

Find (excelFind)

Find literal text in the active worksheet, returning matching A1 addresses. Choose substring or whole-cell matching.

Inputs

IDEditor fieldType/defaultRequirement/use
fromFromAnchor⁠; BEGINNINGFrom / Till.
fromSpecificCellTextFrom cell addressString⁠; emptyThe start A1 address, for example A1⁠. Required here. When from=SPECIFICCELL⁠.
tillTillAnchor⁠; ENDFrom / Till.
tillSpecificCellTextTill cell addressString⁠; emptyThe end A1 address, for example C20⁠. Required here. When till=SPECIFICCELL⁠.
findTextFindString⁠; emptyRequired. Search text.
searchOptionsSearch optionsSearchOptions⁠; BYROWSScan order.
matchCaseMatch caseBoolean⁠; falsetrue requires the same case. false compares without case.
matchEntireCellMatch entire cell contentsBoolean⁠; falsetrue requires the whole cell value to match. false matches a substring.

Also uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultListList of String cell addresses in the chosen scan order. Editor: Assign cell addresses to variable.

Example

Put cat in A1 and Cattle in B2. Set findText=cat. Bind result to matches.

Expected result

matches contains A1, then B2. With whole-cell matching it contains only A1. No match returns an empty List. Empty findText fails.

Back to actions

Find next empty cell (excelFindNextEmptyCell)

Return the first empty cell at or after the starting cell, walking right across a row or down a column. It does not move the active cell.

Inputs

IDEditor fieldType/defaultRequirement/use
traverseByRowTraverse by rowBoolean⁠; truetrue walks right along the row. false walks down the column. The starting cell is tested first.
startFromActiveCellStart from the active cellBoolean⁠; trueSearch start.
cellAddressCell addressString⁠; emptyCell address. When startFromActiveCell=false⁠.

Also uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultStringThe A1 address found. Editor: Assign the output to variable.

Example

Put A in A1 and B in B1; leave C1 empty. Set startFromActiveCell=false, cellAddress=A1. Bind result to emptyAddress.

Expected result

$emptyAddress$ is C1. If the starting cell is already empty, its own address is returned. Empty means the stored value reads as an empty String. Searching beyond the physical worksheet row or column limit can fail.

Back to actions

Get cell color (excelGetCellColor)

Read the fill or font color of a cell as an RGB hex String.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
cellColorOptionBackground colorBoolean⁠; truetrue reads the background fill color. false reads the font color.
cellOptionUse the active cellBoolean⁠; falseActive cell.
cellAddressCell addressString⁠; emptyCell address. When cellOption=false⁠.

Also uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultStringString formatted as #RRGGBB⁠, with uppercase hex digits. Editor: Assign the output to variable.

Example

Prepare B2 with a solid red fill in Excel. Set cellAddress=B2. Bind result to fillColor.

Expected result

$fillColor$ is #FF0000 for that prepared fill. This action does not inspect conditional-format display overrides. An invalid address fails.

Back to actions

Get current worksheet name (excelGetCurrentWorksheetName)

Return the active worksheet name before a temporary sheet switch.

Inputs

Uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultStringThe active worksheet name. Editor: Assign the output to variable.

Example

Open worksheet Data. Bind result to currentSheet.

Expected result

$currentSheet$ is Data. A closed or unknown session fails.

Back to actions

Get multiple cells (excelGetMultipleCells)

Read an active-sheet rectangle into a Table. The session header flag names columns from its first row.

Inputs

IDEditor fieldType/defaultRequirement/use
loopSelectionSelect range of cells to be returnedLoopSelection⁠; ALL_ROWSALL_ROWS reads the used area. SPECIFIC_ROWS reads the given rows, both included, across the used columns. CELL_RANGE reads between the given corners. The order of the corners does not matter. Choices: ALL_ROWS (All rows), SPECIFIC_ROWS (Specific rows), CELL_RANGE (Cell range).
fromRowFrom rowNumber⁠; 1The first worksheet row, starting at 1, for example 2⁠. The session header setting also applies to this first row. When loopSelection=SPECIFIC_ROWS⁠.
toRowTo rowNumber⁠; 1The last worksheet row to include, for example 20⁠. When loopSelection=SPECIFIC_ROWS⁠.
fromCellFrom cellString⁠; emptyOne corner of the range, for example A1⁠. A non-empty valid A1 address is required. When loopSelection=CELL_RANGE⁠.
toCellTo cellString⁠; emptyThe opposite corner, for example B3⁠. Both boundaries are included. When loopSelection=CELL_RANGE⁠.

Also uses session and readOption from the common inputs.

Outputs

IDTypeMeaning/binding
resultTableTable with String columns and cells. Bind to a Table variable, for example rows⁠; $rows[0].Name$ reads Ana in this example. Table row indexes start at 0⁠. Editor: Assign value to the variable.

Example

Open the sample workbook with containsHeader=true. Set loopSelection=CELL_RANGE, fromCell=A1, toCell=B3, readOption=READ_CELL_VALUE. Bind result to rows.

Expected result

rows has String columns Name and Amount, with rows Ana, 12 and Ben, 7. If the range starts at A2, that row becomes the header instead. A blank sheet with headers enabled returns a one-column Table named Column1 and no data rows.

Back to actions

Get number of rows (excelGetNumberOfRows)

Count non-empty rows or return the final used row number, without activating the selected worksheet.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
sheetOptionSelect worksheet bySheetOption⁠; BYINDEXSheet selection.
fetchRowsTypeCountFetchRowsType⁠; NONEMPTYNONEMPTY counts the rows of the used area that have at least one non-empty stored value. TOTALROWS returns the last row of the used area if any value is not empty, otherwise 0⁠. Header rows count. Choices: NONEMPTY (Non-empty rows), TOTALROWS (Total rows with data).

Also uses session, sheetIndex and sheetName from the common inputs.

Outputs

IDTypeMeaning/binding
resultNumberThe row count or final row index. Editor: Assign the output to variable.

Example

In Data, populate rows 1, 2 and 4, leaving row 3 empty. Set sheetOption=BYNAME, sheetName=Data. Bind result to rowCount.

Expected result

rowCount is 3. Changing to TOTALROWS returns 4, the final used row index, not a count excluding gaps. A sheet with no non-empty cells returns 0 for either choice.

Back to actions

Get sensitivity label (excelGetSensitivityLabel)

Read the workbook Microsoft Purview sensitivity label name. This needs a Microsoft 365 Excel version that exposes sensitivity labels.

Advanced required.

Inputs

Uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultStringThe label name, not its ID. Editor: Assign the output to variable.

Example

Open a sample workbook with the label named Internal already applied. Bind result to labelName.

Expected result

$labelName$ is Internal for that prepared workbook. A null label name becomes an empty String. An unsupported Excel label API fails the step.

Back to actions

Get single cell (excelGetSingleCell)

Read one cell as text. Advanced can read the displayed text or the stored value.

Inputs

Uses session, activeCell, cell and readOption from the common inputs.

Outputs

IDTypeMeaning/binding
resultStringThe selected cell content. Bind as String, including numeric cells. Editor: Store cell contents to.

Example

In the sample workbook, set cell=B2, readOption=READ_CELL_VALUE. Bind result to amountText.

Expected result

$amountText$ is the String 12. A blank cell returns an empty String. Numeric display formats affect READ_CELL_TEXT only in Advanced mode.

Back to actions

Get cell address (excelGetSingleCellAddress)

Return the active address, or find a title in the first used row and offset downward.

Inputs

IDEditor fieldType/defaultRequirement/use
columnTitleColumn titleString⁠; emptyThe title to find in the first used row, for example Amount⁠; matching ignores case and uses the first match. Leave empty to report the active cell instead.
cellPositionCell position from column titleNumber⁠; 1The whole-number row offset below the title: 0 is the title cell and 1 is the next row. Keep the resulting address within the worksheet.

Also uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultStringAn A1 address. Editor: Save the active cell address in local variable.

Example

In the sample workbook, set columnTitle=Amount. Bind result to amountAddress.

Expected result

$amountAddress$ is B2. Empty columnTitle returns the active address. A title not found in the first used row fails the step.

Back to actions

Get column name (excelGetSingleColumnName)

Return the selected cell column header when the session has headers, otherwise its column letters.

Inputs

Uses session, activeCell and cell from the common inputs.

Outputs

IDTypeMeaning/binding
resultStringThe header or column letters. Editor: Save the column name into local variable.

Example

Open the sample workbook with containsHeader=true. Set cell=B2. Bind result to columnLabel.

Expected result

$columnLabel$ is Amount. The header is read from worksheet row 1, even if the used area starts lower. Without headers, or with an empty header cell, it returns B.

Back to actions

Get row number (excelGetSingleRowNumber)

Return the cell row number as a String for later text fields.

Inputs

Uses session, activeCell and cell from the common inputs.

Outputs

IDTypeMeaning/binding
resultStringThe row number, starting at 1. Bind to String, not Number. Editor: Save the row number into local variable.

Example

Set cell=C4; bind result to the String variable rowText.

Expected result

$rowText$ is the String 4. Row numbering starts at 1. An invalid address fails.

Back to actions

List external Excel source links. Use their exact values to change or break links.

Advanced required.

Inputs

Uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultTableTable with one String column Link⁠. Bind to a Table variable; $links[0].Link$ is the first link when a row exists. Editor: Assign value to the variable.

Example

Prepare a test workbook with one formula linked to samples/source.xlsx. Bind result to the Table variable links.

Expected result

links has one String column named Link and one row for that external source. With no links, the Table retains the Link column and has zero rows. These are workbook links, not cell hyperlinks.

Back to actions

Get worksheet as data table (excelGetWorksheetAsDataTable)

Read the used area of a worksheet into a Table with its own header option, without activating the sheet.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
sheetSelectionWorksheetSheetSelection⁠; SpecificSheetWorksheet selection.
fromSpecificSheetWorksheet nameString⁠; emptyThe worksheet name, for example Data⁠. Empty uses the active sheet. When sheetSelection=SpecificSheet⁠.
containsHeaderSheet contains a headerBoolean⁠; falsetrue treats the first row of the selected data as column names and excludes it from table rows. Empty header names become Column1⁠, Column2⁠, and so on. false keeps that row as data and generates those column names.

Also uses session and readOption from the common inputs.

Outputs

IDTypeMeaning/binding
resultTableTable whose cells are String values. The first selected row is removed from data when containsHeader=true⁠. Editor: Assign value to the variable.

Example

Use the sample worksheet Data. Set fromSpecificSheet=Data, containsHeader=true, readOption=READ_CELL_VALUE. Bind result to rows.

Expected result

rows has String columns Name, Amount and two rows, Ana, 12 and Ben, 7. With headers disabled the first worksheet row remains data and the columns are Column1, Column2. An unknown sheet fails.

Back to actions

Get worksheet names (excelGetWorksheetNames)

List all worksheet names in workbook order for later sheet selection.

Inputs

Uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultListList of String worksheet names in workbook order. Editor: Assign the output to variable.

Example

Open a workbook with worksheets Data and Archive in that order. Bind result to sheetNames.

Expected result

sheetNames contains Data, then Archive. Hidden sheets are included even if the Advanced session excludes hidden sheets for index selection.

Back to actions

Go to cell (excelGoToCell)

Move the active cell to an A1 address or relative position for later actions.

Inputs

IDEditor fieldType/defaultRequirement/use
cellOptionCell optionCellOption⁠; SpecificCellSpecificCell selects the supplied A1 address. ActiveCell applies the relative selection move. Choices: SpecificCell (Specific cell), ActiveCell (Active cell).
cellCell addressString⁠; emptyCell address. When cellOption=SpecificCell⁠.
selectionMove toSelection⁠; OneCellRightOneCellLeft⁠, OneCellRight⁠, OneCellUp⁠, OneCellDown move one cell. BeginningOfRow moves to column A; BeginningOfColumn to row 1. EndOfRow uses the final used column; EndOfColumn uses the final used row. When cellOption=ActiveCell⁠. Choices: OneCellLeft (One cell to the left), OneCellRight (One cell to the right), OneCellUp (One cell above), OneCellDown (One cell below), BeginningOfRow (Beginning of the row), EndOfRow (End of the row), BeginningOfColumn (Beginning of the column), EndOfColumn (End of the column).

Also uses session from the common inputs.

Outputs

None.

Example

Set cell=C4. Then run Get cell address with an empty columnTitle.

Expected result

The active address is C4. Relative left/up moves stop at row or column 1. End-of-row/column moves use the sheet used-area edge and do not move backward when already beyond it.

Back to actions

Go to next empty cell (excelGoToNextEmptyCell)

Move the active cell to the first empty cell in the chosen direction, starting with the supplied cell itself.

Inputs

IDEditor fieldType/defaultRequirement/use
startFromActiveCellStart from the active cellBoolean⁠; trueSearch start.
cellAddressCell addressString⁠; emptyCell address. When startFromActiveCell=false⁠.
towardsTowardsTowards⁠; leftleft⁠, right⁠, up and down select the direction. Left/up stop at the worksheet edge; right/down search to one cell beyond the used area. Choices: left (Left), right (Right), up (Up), down (Down).

Also uses session from the common inputs.

Outputs

None.

Example

Put A in A1 and B in B1; leave C1 empty. Set startFromActiveCell=false, cellAddress=A1, towards=right.

Expected result

The active cell becomes C1. An empty start cell is selected unchanged. Walking left or up through a fully filled line stops at the sheet edge even if that edge cell is not empty. Searching right or down beyond the physical worksheet limit can fail.

Back to actions

Hide rows/columns in selection (excelHideRowsColumnsInSelection)

Hide whole rows/columns. The span fields select the target.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
hideRowsSelectedHide rowsBoolean⁠; truetrue hides rows from rowsRange⁠; false hides columns from colsRange⁠.
rowsRangeRows rangeString⁠; emptyRow span. When hideRowsSelected=true⁠.
colsRangeColumns rangeString⁠; emptyColumn span. When hideRowsSelected=false⁠.

Also uses session from the common inputs.

Outputs

None.

Example

Set rowsRange=2:3.

Expected result

Rows 2 and 3 become hidden; their data remains. Run Unhide rows/columns in selection with the same span to show them again. Invalid or empty spans fail.

Back to actions

Hide worksheet (excelHideWorksheet)

Hide a named worksheet without removing its contents. Another worksheet must remain visible.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
workSheetNameWorksheet name to hideString⁠; emptyRequired. The existing worksheet name, for example Archive⁠. Excel must retain at least one visible sheet.

Also uses session from the common inputs.

Outputs

None.

Example

Use a workbook with visible Data and Archive sheets. Set workSheetName=Archive.

Expected result

Archive is hidden and its data remains. An unknown sheet, protected workbook structure or an attempt to hide the last visible sheet fails.

Back to actions

Insert/Delete rows/columns (excelInsertDeleteRowColumn)

Insert or delete complete worksheet rows or columns at a supplied position. Deletion removes their values and shifts the remaining data.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
rowOperationsRequestedRow operationsBoolean⁠; truetrue works on rows; false works on columns.
insertInsertBoolean⁠; truetrue inserts whole rows or columns before the target. false deletes them. A span affects the corresponding number of rows or columns.
atAtString⁠; emptyRequired. For rows, enter 3 or a span such as 2:5⁠. For columns, enter B⁠, B:D or a single numeric position such as 2⁠. A column number is converted to letters. A non-empty valid target is required.

Also uses session from the common inputs.

Outputs

None.

Example

Use a test copy of the sample. Set at=2.

Expected result

A blank row is inserted before row 2; Ana moves from row 2 to row 3. With insert=false, row 2 is removed instead. Invalid positions or workbook restrictions fail.

Back to actions

Insert table column (excelInsertTableColumn)

Insert a column at a table position or append it.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
tableNameTable nameString⁠; emptyRequired. Excel table name.
columnNameColumn nameString⁠; emptyThe new column header, for example Status⁠. Empty leaves the name Excel assigns.
columnPositionColumn position (at)Number⁠; 0The insert position in the table, starting at 1. 0 or a negative value adds the column after the last column.

Also uses session from the common inputs.

Outputs

None.

Example

Use table Sales with columns Name, Amount. Set tableName=Sales, columnName=Status.

Expected result

Sales now has a final column named Status. Excel supplies a name if columnName is empty. An unknown table or invalid positive insertion position fails.

Back to actions

Open (excelOpenSpreadsheet)

Open a named workbook session for later steps. Basic reads the file; Advanced starts its own visible Excel instance.

Inputs

IDEditor fieldType/defaultRequirement/use
modeModeExcelMode⁠; BasicMode.
filePathFile pathString⁠; emptyRequired. An existing workbook path, such as samples/report.xlsx⁠. Relative paths use the automation working folder. Advanced also passes an http:// or https:// workbook URL to Excel, including SharePoint URLs. Authentication follows Excel, not the session name.
containsHeaderSheet contains a headerBoolean⁠; falsetrue makes Get multiple cells use the first selected row as column names, and Get column name read worksheet row 1. false reads all selected rows as data.
isSpecificSheetSpecific sheet nameBoolean⁠; falsetrue selects sheetName at opening. false keeps the default active sheet. A selected empty name also keeps the default sheet.
sheetNameSheet nameString⁠; emptyExisting sheet name. When isSpecificSheet=true⁠.
fileAccessModeOpen inFileAccessMode⁠; EDITEDIT opens for reading and writing. READ_ONLY requests a read-only session. It cannot be combined with creation of a missing workbook. Choices: READ_ONLY (Read-only mode), EDIT (Read-write mode).
isSecurePassword is requiredBoolean⁠; falseSet true when the workbook needs an opening password, a modification password, or both. This enables both credential inputs. Basic Open rejects this option.
secureToReadTo openCredential⁠; emptyPassword to open the workbook. Leave it empty when only a password to change the workbook is needed, and set secureToEdit⁠. When isSecure=true⁠.
secureToEditTo editCredential⁠; emptyPassword to change the workbook (write reservation). When mode=Advanced and isSecure=true⁠.
createIfMissingCreate the file if it is missingBoolean⁠; falsetrue creates and immediately saves a missing local workbook when opening in EDIT⁠. It creates Sheet1⁠, or the selected name. Prepare the parent folder first. false reports a missing file. This does not create a workbook at a URL.
loadAddInsLoad Add-insBoolean⁠; falsetrue toggles each installed Excel add-in off and on in the new Excel instance. false does not perform this reload. When mode=Advanced⁠.
excludeHiddenSheetsExclude hidden sheetsBoolean⁠; falsetrue makes supported sheet-index selection count only visible worksheets. It does not remove sheets and does not filter Get worksheet names. When mode=Advanced⁠.
disableUpdateLinksDisable workbook/data link updatesBoolean⁠; truetrue opens without updating workbook links. false asks Excel to update links on open. This is not a continuous refresh setting. When mode=Advanced⁠.
allowMacrosAllow this workbook's macrosBoolean⁠; falsefalse opens the workbook with macros disabled. true permits its macros and is required for Run macro. Enable only for a workbook you trust. When mode=Advanced⁠.
setSensitivitySet sensitivity labelBoolean⁠; falseApply sensitivity. When mode=Advanced⁠.
sensitivityIdSensitivity labelCredential⁠; emptySensitivity ID. When mode=Advanced and setSensitivity=true⁠.
continue_on_error_set_SensitivityContinue on errorBoolean⁠; falseSensitivity errors. When mode=Advanced and setSensitivity=true⁠.

Also uses session from the common inputs.

Outputs

IDTypeMeaning/binding
sessionNameStringString equal to the supplied session name. Bind to a String variable when needed. Editor: Create Excel session.

Example

Prepare samples/report.xlsx with the sample Data sheet. Set filePath=samples/report.xlsx, containsHeader=true, isSpecificSheet=true, sheetName=Data. Bind sessionName to openedSession. For a modification-only protected sample, use mode=Advanced, isSecure=true, leave secureToRead empty and set secureToEdit=$editPassword$, where editPassword is a Credential variable with the known modification password.

Expected result

$openedSession$ is report, and the workbook is available to later steps. Missing files fail unless createIfMissing=true and editing is allowed. Basic rejects password-protected workbooks. Close the session when finished.

Back to actions

Protect workbook (excelProtectWorkbook)

Set a password for opening the workbook, protect its structure, or both. Save afterward to retain the protection in the file.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
isProtectWorkbookA password is required to open the workbookBoolean⁠; falsetrue assigns the opening password from password⁠. false leaves that password unchanged.
passwordPassword to openCredential⁠; emptyPassword. When isProtectWorkbook=true⁠.
isProtectWorkbookStructureProtect workbook structureBoolean⁠; falsetrue protects workbook structure with passwordForStructure⁠. false leaves structure protection unchanged.
passwordForStructurePassword for the structureCredential⁠; emptyPassword for the workbook structure. Empty protects without a password. When isProtectWorkbookStructure=true⁠.

Also uses session from the common inputs.

Outputs

None.

Example

Use a test sample and a Credential variable structurePassword. Set isProtectWorkbookStructure=true, passwordForStructure=$structurePassword$. Then Save workbook.

Expected result

Excel protects the workbook structure, restricting sheet changes until unprotected. An opening password is unchanged when its option is false. This action does not protect individual cell contents.

Back to actions

Password protect worksheet (excelProtectWorksheet)

Protect the active worksheet while allowing the selected operations. This is worksheet protection, not file-opening encryption. Each permission flag grants its operation with true; false grants no permission. Excel protection rules apply.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
passwordPasswordCredential⁠; emptyPassword: the new worksheet password. Empty protects without a password.
allowFormattingCellsFormat cellsBoolean⁠; falsePermit the person to format cells.
allowFormattingColumnsFormat columnsBoolean⁠; falsePermit the person to format columns.
allowFormattingRowsFormat rowsBoolean⁠; falsePermit the person to format rows.
allowInsertingColumnsInsert columnsBoolean⁠; falsePermit the person to insert columns.
allowInsertingRowsInsert rowsBoolean⁠; falsePermit the person to insert rows.
allowInsertingHyperlinksInsert hyperlinksBoolean⁠; falsePermit the person to insert hyperlinks.
allowDeletingColumnsDelete columnsBoolean⁠; falsePermit the person to delete columns.
allowDeletingRowsDelete rowsBoolean⁠; falsePermit the person to delete rows.
allowSortingSortBoolean⁠; falsePermit the person to sort data.
allowFilteringUse AutoFilterBoolean⁠; falsePermit the person to use an existing AutoFilter.
allowUsingPivotTablesUse PivotTable & PivotChartBoolean⁠; falsePermit the person to use PivotTable and PivotChart objects.
drawingObjectsEdit objectsBoolean⁠; falsePermit the person to edit drawing objects.
scenariosEdit scenariosBoolean⁠; falsePermit the person to edit scenarios.

Also uses session from the common inputs.

Outputs

None.

Example

Use a test workbook on Data and a Credential variable sheetPassword. Set password=$sheetPassword$, allowFormattingCells=true. Leave the other permission flags false.

Expected result

The active sheet is protected and cell formatting is allowed. Other operations follow Excel protection rules, including the locked status of cells. Permission flags grant an operation; they do not create tables or unlock cells. Save to retain the settings.

Back to actions

Read cell formula (excelReadCellFormula)

Read a stored cell formula before changing it.

Inputs

Uses session, activeCell and cellAddress from the common inputs.

Outputs

IDTypeMeaning/binding
resultStringThe formula, including =⁠. Editor: Assign the output to variable.

Example

Set cell formula on C2 to =SUM(B2:B3). Then set cellAddress=C2; bind result to formulaText.

Expected result

$formulaText$ is =SUM(B2:B3). Basic returns an empty String for a non-formula cell. Advanced reads Excel Formula directly: a text cell returns its text, while a non-formula numeric cell can fail conversion to String. Use a formula cell when a formula String is required.

Back to actions

Read column (excelReadExcelColumn)

Read a column through the final used row, starting at the supplied cell or row 1 for full-column mode.

Inputs

IDEditor fieldType/defaultRequirement/use
readFullColumnRead full columnBoolean⁠; falsetrue starts at row 1⁠; false starts at the selected row. Both end at the final used row, or the start row if it is lower. This does not read all worksheet rows.

Also uses session, activeCell, cellAddress and readOption from the common inputs.

Outputs

IDTypeMeaning/binding
resultListList of String cell values in top-to-bottom order. Editor: Assign value to the variable.

Example

Use the sample data. Set cellAddress=B2, readOption=READ_CELL_VALUE. Bind result to amounts.

Expected result

amounts contains String items 12, 7. Full-column mode also includes Amount from row 1. Blank cells inside the interval are empty String items. A start below the used area returns one item for that cell.

Back to actions

Read row (excelReadExcelRow)

Read a row through the final used column, starting at the supplied cell or column A for full-row mode.

Inputs

IDEditor fieldType/defaultRequirement/use
readFullRowRead full rowBoolean⁠; falsetrue starts at column A; false starts at the selected column. Both end at the final used column, or the starting column if it is farther right. This does not read every worksheet column.

Also uses session, activeCell, cellAddress and readOption from the common inputs.

Outputs

IDTypeMeaning/binding
resultListList of String values in left-to-right order. Editor: Assign value to the variable.

Example

Use the sample data. Set cellAddress=A2, readOption=READ_CELL_VALUE. Bind result to rowValues.

Expected result

rowValues contains String items Ana, 12. Blank cells inside the interval are empty String items. A start beyond the final used column returns one item for that cell.

Back to actions

Remove blank rows (excelRemoveBlankRows)

Delete completely blank rows within a row interval. Rows are checked across the used columns, then deleted from bottom to top.

Inputs

IDEditor fieldType/defaultRequirement/use
fromBeginningOfTheSheetBeginning rowRowEdge⁠; BeginningOfSheetSpecificRow uses startCellAddress⁠, or startRowNumber if the address is empty. BeginningOfSheet and EndOfSheet both start at row 1⁠. Choices: BeginningOfSheet (Beginning of the sheet), EndOfSheet (End of the filled sheet), SpecificRow (Specific row).
startRowNumberBeginning row numberNumber⁠; 1The first row, starting at 1. Used only if the start cell address is empty. A value below 1 becomes 1⁠. When fromBeginningOfTheSheet=SpecificRow⁠.
startCellAddressBeginning cell addressString⁠; emptyOptional A1 address, for example A2⁠. Only its row is used, and it takes precedence over startRowNumber⁠. When fromBeginningOfTheSheet=SpecificRow⁠.
toEndOfTheFilledSheetEnd rowRowEdge⁠; EndOfSheetSpecificRow uses endCellAddress⁠, or endRowNumber if the address is empty. BeginningOfSheet and EndOfSheet both use the last used row. Choices: BeginningOfSheet (Beginning of the sheet), EndOfSheet (End of the filled sheet), SpecificRow (Specific row).
endRowNumberEnd row numberNumber⁠; 1The last row, included. Used only if the end cell address is empty. The action never scans past the last used row. When toEndOfTheFilledSheet=SpecificRow⁠.
endCellAddressEnd cell addressString⁠; emptyOptional A1 address, for example B20⁠. Only its row is used, and it takes precedence over endRowNumber⁠. When toEndOfTheFilledSheet=SpecificRow⁠.

Also uses session from the common inputs.

Outputs

None.

Example

Use a test sheet with a header in row 1, Ana in row 2, an empty row 3 and Ben in row 4. Run the action.

Expected result

Row 3 is deleted and Ben moves to row 3. A row containing spaces is not blank. A formula whose stored value reads empty can count as blank. A bounded interval outside the data makes no change. A read-only session fails.

Back to actions

Rename worksheet (excelRenameWorksheet)

Rename a worksheet by name or position, without copying cells.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
sheetOptionWorksheet bySheetOption⁠; BYNAMESheet selection.
sheetNameWorksheet nameString⁠; emptyExisting sheet name. When sheetOption=BYNAME⁠.
sheetIndexWorksheet indexNumber⁠; 1Existing sheet index. When sheetOption=BYINDEX⁠.
newSheetNameNew name for worksheetString⁠; emptyRequired. The non-empty new worksheet name, for example Report⁠. It must be valid in Excel and unique in the workbook.

Also uses session from the common inputs.

Outputs

None.

Example

Set sheetName=Data, newSheetName=Report.

Expected result

The sheet is named Report and retains its cells. A duplicate name, invalid Excel sheet name or protected workbook structure fails.

Back to actions

Replace (excelReplace)

Replace every matching value or part of a value in the selected area.

Inputs

IDEditor fieldType/defaultRequirement/use
fromFromAnchor⁠; BEGINNINGFrom / Till.
fromSpecificCellTextFrom cell addressString⁠; emptyThe start A1 address, for example A1⁠. Required here. When from=SPECIFICCELL⁠.
tillTillAnchor⁠; ENDFrom / Till.
tillSpecificCellTextTill cell addressString⁠; emptyThe end A1 address, for example C20⁠. Required here. When till=SPECIFICCELL⁠.
findTextFindString⁠; emptyRequired. Search text.
searchOptionsSearch optionsSearchOptions⁠; BYROWSScan order.
matchCaseMatch caseBoolean⁠; falsetrue requires the same case. false compares without case.
matchEntireCellMatch entire cell contentsBoolean⁠; falsetrue requires the whole cell value to match. false matches a substring.
replaceWithReplace withBoolean⁠; falsetrue replaces with replaceText⁠. false replaces matches with an empty String, removing the matched text.
replaceTextReplace textString⁠; emptyThe replacement text, for example dog⁠. Empty removes matched text. Whole-cell matching replaces the complete cell; substring matching replaces each matching occurrence. When replaceWith=true⁠.

Also uses session from the common inputs.

Outputs

None.

Example

Put cat in A1 and cattle in A2. Set findText=cat, replaceWith=true, replaceText=dog; keep the beginning/end anchors.

Expected result

A1 becomes dog and A2 becomes dogtle. With replaceWith=false, matched text is removed. No match changes nothing. Replacement writes values back and can replace a formula with its resulting text. Read-only sessions fail.

Back to actions

Retrieve sheets count (excelRetrieveSheetsCount)

Count worksheets in the workbook, with an option to omit hidden worksheets.

Inputs

IDEditor fieldType/defaultRequirement/use
excludeHiddenWorksheetsExclude hidden worksheetsBoolean⁠; truetrue counts only visible worksheets. false counts every worksheet, including hidden sheets and sheets hidden with Very hidden.

Also uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultNumberCount of worksheets included by the option. Editor: Assign the output to variable.

Example

Use a workbook with visible Data and hidden Archive. Bind result to sheetCount.

Expected result

sheetCount is 1. Setting excludeHiddenWorksheets=false returns 2. The choice is independent of the Open step hidden-sheet index option.

Back to actions

Run macro (excelRunMacro)

Run a workbook macro with up to 30 text arguments. The session must have been opened in Advanced mode with macros explicitly allowed.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
macroNameMacro nameString⁠; emptyRequired. The existing callable Excel macro name, for example WriteSample⁠. Must be non-empty.
macroArgsMacro argumentsString⁠; emptyZero to 30 comma-separated arguments. Each item is trimmed and passed as text. There is no CSV quoting or escaping; a comma always separates arguments. Empty supplies no arguments.

Also uses session from the common inputs.

Outputs

None.

Example

Prepare a trusted test .xlsm workbook with a no-argument macro WriteSample that writes Ready to Data!A1. Open it with mode=Advanced, allowMacros=true. Set macroName=WriteSample, leave macroArgs empty, and run this action.

Expected result

The prepared macro writes Ready to Data!A1. Its effects depend on the macro code. Missing macros, more than 30 arguments, or a session with macros disabled fail. No macro return value is captured.

Back to actions

Save as (excelSaveAs)

Save a report copy at another path, making it the session current file.

Inputs

IDEditor fieldType/defaultRequirement/use
filePathFile pathString⁠; emptyRequired. The new output path, for example samples/report-copy.xlsx⁠. Basic writes .xlsx⁠; Advanced selects a supported Excel format from the extension. The session moves to this path after saving.
isOverwriteReplace existing fileBoolean⁠; falseOverwrite.

Also uses session from the common inputs.

Outputs

None.

Example

Set filePath=samples/report-copy.xlsx, with no existing target file.

Expected result

The copy is written and later Save workbook steps save to report-copy.xlsx. Missing parent folders are created. An existing target fails unless replacement is enabled. The original file is not updated by later saves in this session.

Back to actions

Save workbook (excelSaveSpreadSheet)

Write the current workbook changes to the session current file. The session stays open.

Inputs

IDEditor fieldType/defaultRequirement/use
displayReadOnlyErrorReport an error when the file is read-onlyBoolean⁠; falsetrue fails if the session is read-only. false returns without writing in that case. This rule applies to both modes.

Also uses session from the common inputs.

Outputs

None.

Example

Set B2=15 with Set cell in a writable session. Then set displayReadOnlyError=true and run Save workbook.

Expected result

The file now contains 15 in B2 and the session remains open. A read-only session skips the save when displayReadOnlyError=false, or reports an error when true. Filesystem and Excel save errors fail the step.

Back to actions

Select cells/rows/columns (excelSelectRowColumnCellRange)

Select cells or whole rows/columns for later selection or active-cell operations.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
selectionSelectSelectWhat⁠; CellRow selects entire rows, Column entire columns, and Cell individual cells or a cell range. Choices: Row (Row), Column (Column), Cell (Cell).
howWhichSelectHow⁠; ActiveActive uses the active cell or its row/column. Specific uses one supplied address, row or column. Range uses the supplied span. AllCells selects the whole worksheet. Choices: Active (The active one), Specific (A specific one), Range (A range), AllCells (All cells in the sheet).
valueRow number, column name, cell address or rangeString⁠; emptyFor Row use 3 or 2:5⁠; for Column use B or B:D⁠; for Cell use C7 or A1:C9⁠. Supply a non-empty value for Specific or Range. When (how=Specific or how=Range).

Also uses session from the common inputs.

Outputs

None.

Example

Set how=Range, value=A1:B3.

Expected result

Excel selects A1:B3. AllCells selects the whole worksheet regardless of selection. Empty explicit addresses or invalid spans fail. No data is changed by selecting.

Back to actions

Set cell (excelSetCell)

Write text or a value into one cell. Basic turns numeric text such as 12.5 into a number. Advanced lets Excel read the value as typed.

Inputs

IDEditor fieldType/defaultRequirement/use
setCellTypeUseSetCellType⁠; CELLCELL writes to the supplied address. ACTIVE_CELL writes to the active cell. An empty supplied address also uses the active cell. Choices: ACTIVE_CELL (Active cell), CELL (Specific cell).
cellCell addressString⁠; emptyCell address. When setCellType=CELL⁠.
valueValue to setString⁠; emptyA String value, such as Ana or 42⁠, or a String variable reference. Basic parses numbers with . as the decimal separator; Advanced follows Excel interpretation and cell format. Empty writes an empty String.

Also uses session from the common inputs.

Outputs

None.

Example

Set cell=B2, value=42. Read it with Get single cell using READ_CELL_VALUE.

Expected result

B2 contains numeric 42, and Get single cell returns String 42. Existing contents are replaced. Basic stores non-numeric strings as text, including text that looks like a formula; use Set cell formula to create formulas in both modes. Read-only sessions fail.

Back to actions

Set cell formula (excelSetCellFormula)

Store an A1 cell formula instead of literal text.

Inputs

IDEditor fieldType/defaultRequirement/use
cellFormulaToApplyFormulaString⁠; emptyRequired. The non-empty formula in A1 notation, for example =SUM(B2:B3)⁠. The leading = is optional. For a $⁠, type $$⁠: =$$B$$2*2 stores =$B$2*2⁠. A String variable that holds the formula also works. Use a formula that the selected mode supports.

Also uses session, activeCell and cellAddress from the common inputs.

Outputs

None.

Example

Put numeric 12 in B2 and 7 in B3. Set cellAddress=C2, cellFormulaToApply=SUM(B2:B3).

Expected result

Read cell formula returns =SUM(B2:B3). The action adds the leading = if absent. The stored formula replaces any previous content. Formula calculation support differs between Basic and installed Excel; use Read cell formula to check what was stored. Read-only sessions fail.

Back to actions

Set sensitivity label (excelSetSensitivityLabel)

Apply a Microsoft Purview sensitivity label ID to the workbook. This needs a supported Microsoft 365 Excel installation and a valid label ID.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
labelIdSensitivity labelCredential⁠; emptySensitivity ID.
continue_on_error_set_SensitivityContinue on errorBoolean⁠; falseSensitivity errors.

Also uses session from the common inputs.

Outputs

None.

Example

Ask your label administrator for a test label ID. Store it in the password of Credential variable testLabel. Set labelId=$testLabel$. Read the label name with Get sensitivity label.

Expected result

Excel assigns the supplied label. Get sensitivity label returns its configured name when the API supports it. Invalid IDs or unsupported label support fail with continue-on-error off. With it on, the step can return without applying a label.

Back to actions

Sort (excelSortTableV2)

Sort an Excel table or worksheet range by one key. Keep all related columns together to preserve records.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
sortOptionSortSortOption⁠; SortTableSortTable sorts the named Excel table with its header retained. SortWorksheet sorts the used area or explicit cell range on the chosen worksheet. Choices: SortTable (Table), SortWorksheet (Worksheet).
tableNameTable nameString⁠; emptyExcel table name. When sortOption=SortTable⁠.
worksheetNameSheet nameString⁠; emptyA worksheet name, for example Data⁠, or leave empty to use the active sheet. When sortOption=SortWorksheet⁠.
columnOptionSort forColumnOption⁠; ColumnNameColumnName selects a header in the first row. ColumnNumber selects a column in the data range, starting at 1. CellRange uses worksheetCellRange on a worksheet and sorts by its first column. On a table, CellRange still sorts that table by its first column. Choices: ColumnName (Column name), ColumnNumber (Column position), CellRange (Cell range).
columnNameColumn nameString⁠; emptyColumn header. When columnOption=ColumnName⁠.
columnNumberColumn positionNumber⁠; 1Column position. When columnOption=ColumnNumber⁠.
worksheetCellRangeCell rangeString⁠; emptyFor worksheet sorting with CellRange, enter the full data rectangle, for example A1:B20⁠. It includes the header if hasHeader=true⁠. When columnOption=CellRange⁠.
applySortOnAllColumnsApply sort on all columnsBoolean⁠; trueKeep true to move full rows of the used area together. false sorts only the chosen column, which can break the association with other columns. Used only for worksheet sorting by column name or number. When sortOption=SortWorksheet and (columnOption=ColumnName or columnOption=ColumnNumber).
hasHeaderData has headersBoolean⁠; truetrue keeps the first data-range row as a header. false sorts that row as data. Excel tables always use a header regardless of this field. When sortOption=SortWorksheet⁠.
sortBySort bySortBy⁠; SortByNumberSortByNumber asks Excel to treat numeric text as numbers. SortByText uses normal Excel sort interpretation. Choices: SortByNumber (Number), SortByText (Text).
sortOrderSort orderSortOrder⁠; AscendingAscending sorts smallest to largest or A to Z. Descending reverses that order. Choices: Ascending (Smallest to largest, A to Z), Descending (Largest to smallest, Z to A).

Also uses session from the common inputs.

Outputs

None.

Example

Use the sample Sales table with Ana, 12 and Ben, 7. Set tableName=Sales, columnName=Amount.

Expected result

The header stays first; Ben with 7 precedes Ana with 12. Turning off all-column sorting on a worksheet sorts only the selected column and can separate values from the rest of each record. Missing names, invalid positions or Excel restrictions fail.

Back to actions

Get table range (excelTableGetRange)

Return the A1 range of an Excel table or pivot table, with an option to include its header area.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
tableNameTable nameString⁠; emptyRequired. The existing Excel table or pivot table name, for example Sales or SalesPivot⁠. Lookup searches all worksheets without case.
includeHeaderRowIncludes headerBoolean⁠; falsetrue returns the whole table, with headers; for a pivot table, the whole table without its page fields. false returns only the data area. The whole table can include a totals row.
isPivotTablePivot tableBoolean⁠; falsefalse searches Excel table objects. true searches PivotTable objects.

Also uses session from the common inputs.

Outputs

IDTypeMeaning/binding
resultStringA relative A1 range address and no sheet name. Editor: Assign the output to variable.

Example

Use table Sales covering A1:B3. Set tableName=Sales, includeHeaderRow=true. Bind result to salesRange.

Expected result

$salesRange$ is A1:B3. With headers excluded, the ordinary sample table returns A2:B3. A missing table fails. A table with no data rows has no data area, so includeHeaderRow=false can fail instead of returning an empty address.

Back to actions

Unhide all worksheets (excelUnhideAllWorksheet)

Make every worksheet visible, including sheets hidden with Very hidden.

Advanced required.

Inputs

Uses session from the common inputs.

Outputs

None.

Example

Use a workbook with visible Data and hidden Archive. Run the action.

Expected result

Both worksheet tabs are visible. No data is deleted. Workbook structure protection can block the change and fail the step.

Back to actions

Unhide rows/columns in selection (excelUnhideRowsColumnsInSelection)

Show whole rows/columns in the span without changing values.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
unhideRowsSelectedUnhide rowsBoolean⁠; truetrue shows rows from rowsRange⁠; false shows columns from colsRange⁠.
rowsRangeRows rangeString⁠; emptyRow span. When unhideRowsSelected=true⁠.
colsRangeColumns rangeString⁠; emptyColumn span. When unhideRowsSelected=false⁠.

Also uses session from the common inputs.

Outputs

None.

Example

After hiding rows 2:3, set rowsRange=2:3.

Expected result

Rows 2 and 3 are visible again with their existing data. Invalid or empty spans fail. AutoFilter visibility is controlled by the filter rather than this hiding option.

Back to actions

Unhide worksheet (excelUnhideWorksheet)

Show a named worksheet, keeping its data and workbook position.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
workSheetNameWorksheet name to unhideString⁠; emptyRequired. The existing worksheet name, for example Archive⁠. Excel must retain at least one visible sheet.

Also uses session from the common inputs.

Outputs

None.

Example

Use a workbook with hidden Archive. Set workSheetName=Archive.

Expected result

The Archive tab is visible. An already-visible sheet stays visible. An unknown name or protected workbook structure fails.

Back to actions

Unprotect workbook (excelUnprotectWorkbook)

Remove the opening password, workbook structure protection, or both. This changes an already open workbook and does not recover a forgotten password.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
isProtectWorkbookA password is no longer required to open the workbookBoolean⁠; falsetrue clears the workbook opening password. false leaves it unchanged. Save the workbook to retain the removal.
isProtectWorkbookStructureUnprotect workbook structureBoolean⁠; falsetrue removes structure protection with the supplied structure password. false leaves it unchanged.
passwordForStructurePassword for the structureCredential⁠; emptyPassword: the current structure password. Leave it empty only for protection without a password. When isProtectWorkbookStructure=true⁠.

Also uses session from the common inputs.

Outputs

None.

Example

Use the protected test sample and its Credential variable structurePassword. Set isProtectWorkbookStructure=true, passwordForStructure=$structurePassword$. Save afterward.

Expected result

Structure protection is removed if the supplied password is correct. The opening password remains unchanged in this example. Save retains the change in the file. A wrong structure password fails.

Back to actions

Access password protected worksheet (excelUnprotectworksheet)

Remove protection from the active worksheet using its current password. This does not open an encrypted workbook.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
passwordPasswordCredential⁠; emptyPassword.

Also uses session from the common inputs.

Outputs

None.

Example

Activate the protected sample sheet Data. Set password=$sheetPassword$ using its known Credential variable.

Expected result

Excel removes protection from Data; its cell values remain. A wrong password fails. A sheet with no protection remains unprotected.

Back to actions

Change the source path of an existing external workbook link. Use the exact old link returned by Get workbook links.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
oldSourceLinkOld source linkString⁠; emptyRequired. The exact existing source link reported by Get workbook links. It is passed to Excel unchanged.
newSourceLinkNew source linkString⁠; emptyRequired. The replacement source workbook link, preferably a full path to an existing sample file. It is passed to Excel unchanged.

Also uses session from the common inputs.

Outputs

None.

Example

On a test sample linked to C:\AutomationSamples\source.xlsx, prepare C:\AutomationSamples\replacement.xlsx. Set oldSourceLink=C:\AutomationSamples\source.xlsx, newSourceLink=C:\AutomationSamples\replacement.xlsx.

Expected result

The link points at replacement.xlsx; Get workbook links reports the new source. The action does not create the replacement file. Save to keep the link change.

Back to actions

Write from data table (excelWriteDataTableToWorksheet)

Write a Table variable as one rectangle, overwriting its cells and preserving cells outside it.

Advanced required.

Inputs

IDEditor fieldType/defaultRequirement/use
tableObjData table variableTable⁠; empty schema and rowsRequired. A Table variable, for example $rows$⁠, filled by an earlier step. Its columns give the headers. Missing cells in short rows are written empty.
sheetSelectionWorksheetSheetSelection⁠; SpecificSheetWorksheet selection.
fromSpecificSheetWorksheet nameString⁠; emptyThe worksheet name, for example Data⁠. Empty uses the active sheet. When sheetSelection=SpecificSheet⁠.
firstCellAddressSpecify the first cellString⁠; A1The top-left target A1 address, for example A1 or D5⁠. Empty falls back to A1⁠.
isRetainCellFormatRetain cell data typeBoolean⁠; falsefalse formats the target cells as text (@). true keeps the current format, and Excel reads the values. The action writes text either way; Table column types do not carry over.
writeHeaderWrite the column names as the first rowBoolean⁠; truetrue writes Table column names in the first target row, followed by data. false writes only data rows.

Also uses session from the common inputs.

Outputs

None.

Example

First read the sample Data worksheet into the Table variable rows with Get worksheet as data table and containsHeader=true. Create a worksheet Copy. Set tableObj=$rows$, fromSpecificSheet=Copy.

Expected result

Copy!A1:B3 contains the Name, Amount headers and the two sample rows. With retain off, the target cells get text format. A table with no columns, or with no rows when writeHeader=false, changes nothing. Cells outside the written area stay the same.

This package has no conditions.

Back to actions