This Document type is used to export data directly in to a Sheet in a Microsoft Excel Workbook from the DriveWorks project.
To work effectively the Sheet to export the data to should contain named cells. DriveWorks will recognize the named cells and allow rules to be built for the values to export.
DriveWorks can use .xls, .xlsx and .xlsm files.
Files saved as an .xlsx are the quickest to generate as DriveWorks does not need to open Excel.
To Add an Excel Workbook document:
In DriveWorks Administrator open the Project the Document is to be applied and go to Stage4: Output Rules then Documents - Files
- Click the "Add" button on the command bar.
- Choose the Excel Workbook Document from the list on the Add Document wizard.
- Give the new Document a name.
- Click "Next" and then Browse to the location of the Excel file using the "Browse" button.
- Select the file and click Open and the click "Finish".
To Edit an Excel Workbook:
- The Master Workbook Path is the location of the master file, which can be browsed to if the location of the file changes by clicking the "Browse..." button.
- The Document Name is the name that will be given to the newly created file. This can be built by clicking the "Build..." button.
- The Document Path is the location where the new copied file is going to be stored. This can be built by clicking the "Build..." button.
Please see Info: Where To Store DriveWorks Data for information on where to store the data associated to a DriveWorks implementation.
- The Named Ranges is a range of cells that DriveWorks will write information into. The rules for the named ranges can by built by selecting the named range from the list and clicking the "Build..." button. The data can also be refreshed to bring in new named ranges by clicking the "Refresh" button.
- DriveWorks can create a HTML version of the Document to open in a web browser by checking the "HTML Output" option in the General Settings.
When using DriveWorks Live
When creating HTML files ensure the created document is located in its own folder so access is only provided to the files used in the resulting document.
Microsoft Excel and Word Document Generation
Ensure the projects being specified through DriveWorks Live have
any Microsoft Excel or Word documents generated by an Automatic
State in the Specification Flow. This will allow these documents to
be created by DriveWorks Autopilot and not DriveWorks Live (which
it will not be able to do when running as a service through IIS).
Services do not have access to many programs, especially COM programs such as Microsoft Word and Excel
To maximize performance and for the best user experience, we recommend that as much processing as possible happens when in an Automatic state (Since the processing will be performed by DriveWorks Autopilot).
- The General Setting, Hide from Document List is used to hide the Document from the Document List in the Specification Explorer.
The Document Name will need to be unique if the Document is created in the same location for each Specification, otherwise existing Documents will be overwritten.
The Document can be Deleted if it is not required by making the result of the Document name return Delete.
At any point a HTML preview can be created by clicking the "Preview" button on the command bar.
If the Document Path is not set then the file will be created in the Specification Folder.
How to Create a Named Range in Excel
- Open the Excel Workbook and select the cell that is to be the Named Range.
- Activate the Formulas tab and open the Define Name dialog.
- Select Workbook as the scope level.
When using .xlsm (Excel macro-enabled workbook) files
When creating Named Ranges, in Excel, it is possible to set the scope to be at the local worksheet level (the default is at the global workbook level)
Named Ranges set to the local worksheet level (for example: Sheet1) will not be driven for .xlsm file types.
- Give the cell a unique name and click 'OK'.
- Save and close the workbook.
Running Macros on an Excel Workbook Document
DriveWorks will automatically execute a macro called CreateReports, after driving all the captured cells and prior to the new Document being saved.
The CreateReports macro must exist in a module named DriveWorks, in the VBA Project for the Document.
The Excel Workbook Document is triggered in the Specification Flow by the Release Documents task.