Home Search

DriveWorks Pro 22
Copy Excel Sheets

Send Feedback

Copy Excel Sheets

This Specification Flow Task retrieves a specified sheet and creates named copies. The copies can be placed at the start or end of the current sheets in the Workbook.

Microsoft Office

  • Ensure Microsoft Office is installed on all DriveWorks machines that will process this Task.

Microsoft Office and DriveWorks Live running as a service through IIS

Services (IIS) do not have access to many applications, especially COM programs such as Microsoft Word and Excel.

When using DriveWorks Live and IIS please read the following articles for information on where to place this Task.

Properties

Property NameDescription
TitleChanges the title (not the name) of the task.
Path to WorkbookThe path to the workbook (including the workbook file).
Sheet NamesA single columned table array of sheet names to create from the "Sheet to Copy" property. (Maximum character length of each sheet name is 31).
Insert at StartTrue to insert the specified sheets before the pre-existing sheets, false to insert after.
Sheet to CopyThe sheet to create copies of.

Example

When this Task is added the properties are static. To be able to build rules on a static property see How To: Change A Static Property To A Dynamic Property.

Property NameExample RuleExample ResultMeaning
Path to Workbook"D:\Book1.xlsx"D:\Book1.xlsxThis will modify the workbook located at D:\Book1.xlsx.
Sheet Names{"";"sheet1";"sheet2";"sheet3"}{"";"sheet1";"sheet2";"sheet3"}The single columned table array of sheet names to create from the 'sheet to copy'.
Insert at StartFalseFALSEWill insert the sheets after any pre-existing sheets.
Sheet to Copy"Table1"Table1The sheet to create copies of.

Sheet Names Property

An easy method of creating a single column array is to use the TableFromList function.

Result

The worksheets tab at the bottom of the Microsoft Excel workbook looks like the image below before the Task is run.

The worksheets tab at the bottom of the Microsoft Excel workbook will look like the image below after the Task is run.

Using the Task in a Specification Macro

This task has different types of Outputs. For more information about Outputs see Specification Macros Task Node.

Outputs are only available within Specification Macros. Currently Outputs are not available for Specification Flow.

Status Outputs

This task supports Status Outputs. These can be used to perform different actions depending on what the status outcome of the task is. For more information see Status Outputs in the Task Node Outputs section of Specification Macros Task Node.

The status output navigation is as follows:

Success

  • Successfully added <number of sheets> sheet(s) to the Workbook <specified workbook>.

Success with Warnings

  • N/A - Should never be fulfilled.

Failed (one of the following occurred).

  • The property 'Path to Workbook' cannot be left empty.
  • The property 'Sheet to Copy' cannot be left empty.
  • The Workbook at path <Workbook path> does not exist or cannot be accessed.
  • The Workbook path contains an unsupported file extension <file extension>. The supported file extensions are: .xls, .xlsx, .xlsm, .xlsb.
  • The property 'Sheet Names' contains an invalid amount of columns. Only single column arrays are accepted.
  • The property 'Sheet Names' contains too few rows.
  • One or more of sheet names provided is empty: <Sheet Names>.
  • The sheet names provided contains duplicates: <Sheet Names>.
  • One or more of the sheet names provided already exists within the Workbook:
    • Provided sheet names: <Sheet Names>.
    • Provided Excel sheet name: <Excel Sheet Name>.
  • Failed to insert sheet(s) <Sheet Names> at path <Path to Workbook>.