Home Search

DriveWorks Pro 22
Import Named Sheet From Excel Into Constants And Controls

Send Feedback

Import Named Sheet From Excel Into Constants And Controls

This Specification Flow Task reads in multiline, two column data from a named sheet in an Excel file, and passes them into the specification for driving into constants or controls.

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.
Sheet NameSheet to pull the data from.
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
FileName"C:\MyDocuments\ExcelFiles\ExcelData.xlsx"C:\MyDocuments\ExcelFiles\ExcelData.xlsxThis is the Full File Path for the Excel document to use.
Sheet Name"DataToUse"DataToUseThis is the name of the Sheet in Excel
Show ExcelTRUETRUETRUE to show the Excel Application when the Task is run.
Return Constant"DWConstantReport"DWConstantReportThis is the name of the Constant that the Task will report to with

How To Set Up Your Excel Document

The Excel sheet used for the import needs to have two columns:

  • The first column with the header Name contains the names of the Constant or Control (do not include the DWConstant prefix or the Return suffix).
  • The second column with the header Value contains the values to be passed into the Constants or Controls.

The Table containing the names and values should be positioned with the Name header in cell A1.

If a Constant is found with the same name (Not case sensitive) then the value from the second column will be passed into it.

If no Constant is found with that name, then DriveWorks will look for a Form Control with that name to pass the value to.

If no Control is found, then no action will be taken with that rows data.

If a Constant and Control exist with the same name the Constant will take priority.

Example Data

Here is an example table showing how the data should be laid out.

NameValue
OverallLength485
ClevisOptionUniversal Clevis
TotalPrice$253.75

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 successfully imported from Excel

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
  • Target sheet name is empty
  • Could not find the Excel sheet
  • Unknown error occurred