Skip to main content

Add worksheet to Excel

Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

This command adds a new worksheet to the specified Excel file. It allows you to insert a worksheet at either the beginning or end of the workbook, providing flexibility in organizing your Excel data.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Excel instance

Please select an Excel instance (created via the "Launch Excel" or "Get active Excel worksheet" command) to identify the instance to operate on.

Yes

Must reference a valid Excel instance

Worksheet name

Specify the name of the new worksheet

Yes

Can use variables to dynamically set worksheet names

Insert at

Specify where to insert the new worksheet in the workbook

Beginning, End

Yes

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action doesn't produce any variables.


Using Variables in Conditions

You can use variables in the "Worksheet name" parameter by clicking the {x} icon, which allows you to insert previously defined variables. This is particularly useful when you need to create worksheets with dynamic names based on data processed earlier in your workflow.


Notes

  • Before using this command, ensure that a valid Excel instance has been created using either the "Launch Excel" or "Get active Excel worksheet" command.

  • If a worksheet with the specified name already exists in the workbook, the command will generate an error.

  • The "Insert at" parameter determines the position of the new worksheet within the workbook structure.

  • Worksheet names must follow Excel's naming conventions (cannot exceed 31 characters, cannot contain certain special characters like /, \, ?, *, [, ], etc.).

Did this answer your question?