Copy Excel Workbook

This is a pre-built Action located under the @Excel Element. The functionality of this Action in Avo Assure is to copy the content from one Excel file to another. The result of this operation is stored in a dynamic variable for further use during test execution.

Syntax

Input Value: <FilePath1>;<FilePath2>;<Option>(Optional);<text/special>(Optional)

Argument
Description

<FilePath1> (Required)

Provide the path of the source Excel workbook (first Excel file).

<FilePath2> (Required)

Provide the path of the destination Excel workbook (second Excel file).

<Option>

Option (Optional) Defines the sheet copy behavior.

  • 0 or empty: Appends unique sheets and overwrites common sheets.

For more information on how to use the Option parameter, refer to the note section below.

<text/special> (Optional)

Copy method

  • text: copies only data

  • special: copies data with formatting (Windows OS only).

For more information on how to use the text/special parameter, refer to the note section below.

Note:

  • Option (Optional) Defines how the sheets are copied from the source Excel file to the destination Excel file. When performing a sheet copy between two Excel files, the Option parameter controls how the sheets are copied:

    • If the value is set to 0 or left blank, the action performs the following:

      • Appends unique sheets Sheets that exist only in the source file are added to the destination file.

      • Overwrites common sheets If both files have a sheet with the same name, the sheet in the destination file is replaced by the one from the source file.

  • Text/Special (Optional) Specifies how the data is copied between two Excel files.

    When you copy sheets between two Excel files, you can choose how the data is copied using the Text/Special parameter:

    • If the value is set to text, only the cell data (values) will be copied no colors, fonts, or formatting.

    • If the value is set to special, both the cell data and formatting (such as bold text, colors, borders, etc.) will be copied.

    • The special option works only on Windows OS.

Output Value: <Dynamic Variable>(Optional);<Dynamic Variable>(Optional)

Argument
Argument

<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)

Both dynamic variable stores the status as True or False.

Example: Copying Data from One Excel Workbook to Another

In this example, we explain how to copy content from one Excel workbook to another using the Copy Excel Workbook action.

  • Action: Copy Excel Workbook

  • Input Value: C:\Test\Source.xlsx;C:\Test\Destination.xlsx

    • The input value (C:\Test\Source.xlsx;C:\Test\Destination.xlsx) specifies the source and destination Excel file paths. The action copies all the content from the source workbook (Source.xlsx) to the destination workbook (Destination.xlsx).

  • Output Value: {Status}

    • The execution status of the action is stored in this {Status} variable with the following possible values:

      • True: If the workbook is copied successfully.

      • False: If the workbook is not copied successfully.

  • Logical Explanation: The Copy Excel Workbook action reads the value from the Input Value column C:\Test\Source.xlsx;C:\Test\Destination.xlsx and performs a copy operation from the specified source file to the destination file. After execution, the result of this operation is stored in the {Status} variable as true.

Last updated

Was this helpful?