Home Search

DriveWorks Pro 22
Import Named Range Values from Excel into Constants and Controls

Send Feedback

Import Named Range Values From Excel Into Constants And Controls

This Specification Task reads in all data found in named ranges in an Excel file and passes them into the Specification for driving into Constants or Controls.

Named Ranges

  • Avoid using any merged cells as the named range.
  • When applying a Named Range using the Name Manager (in Microsoft Excel) it is possible to set the scope of the range to be worksheet specific. We recommend only using workbook specific ranges when setting up the Excel workbook to export into.

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.
File NameFile Name of the Excel File Including Extension.
Show ExcelWorkbook will be visible if set to True.
Return ConstantThe name of the Constant that the named pairs will be posted to for reference.

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
File Name"C:\MyDocuments\ImportExcel.xlsx"C:\MyDocuments\ImportExcel.xlsxThis is the Full File Path including extension for the Excel File to import the Range values for the Constants and Controls.
Show ExcelTRUETRUETRUE will show the Excel workbook opening when you run the Task.
Return Constant"ImportReport"ImportReportThis is the name of the Constant that the Task will report to.

Example Excel File

The highlighted cells in the Excel example below have been named as follows:

  • Cell C1 - Customer
  • Cell B2 - Color
  • Cell D3 - Width
  • Cell A4 - Type
  • Cell E5 - Email

For information on how to name a range in Excel, please see Name a cell (Microsoft Office article).

ABCDE
1DriveWorks Ltd.
2Green
3760
47/16-20 UNF
5sales@driveworks.co.uk

The DriveWorks Project these values will be imported into contains the following Constants and Controls.

  • Control - Customer
  • Control - Color
  • Control - Width
  • Constant - Type
  • Constant - Email
If a constant and control exist with the same name the constant will take precedence.

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

  • Data from Excel was successfully imported

Success with Warnings

  • N/A - Should never be fulfilled.

Failed (one of the following occurred).

  • File name is empty
  • Target file not found or could not be accessed
  • Target file extension is invalid
  • Unknown error occurred