Skip to main content

Sheet From Workbook

The Sheet From Workbook function is used to import an entire Source Sheet to a Target Sheet.

Settings

Directory

The directory where the Excel workbook to import the worksheet from exists. If this is left blank, the Reports Directory of the current project is used (as defined in the Project Explorer). If this is not a full path reference, the setting is used as subfolders of the Reports Directory.

This can be a fixed name or cell reference where the cell reference contains the directory. Fixed names can contain XLReporter Name Types like {YYYY}, {MMM}, etc. See the Name Types chapter for the full list of supported keywords.

Workbook Name

The name of the workbook to import the worksheet from.

This can be a fixed name or cell reference where the cell reference contains the directory. Fixed names can contain XLReporter Name Types like {YYYY}, {MMM}, etc.

If this setting contains a full path, that path is used as the Directory.

In addition, the Workbook Name can be specified with a wildcard. This changes the setting from a specific file name to a filter that is used to get the most recent file in the Directory specified. For example, a Workbook Name of Flow*.xlsx would import data from the most recent file in the Directory that starts with Flow and ends with .xlsx.

Source Sheet

The name of the worksheet to import.

Target Sheet

If specified, when the worksheet is imported into the report workbook this name is applied. Otherwise, the worksheet name is not changed.

If the target sheet name already exists in the report workbook, the name is rebuilt as Workbook Name-Target Sheet (truncated to 31 characters). If that sheet exists, a default name (e.g., Target Sheet (2)) is used.

Hyperlink Cell

A hyperlink can be added to the sheet(s) imported to navigate back to the Active By worksheet which may contain summary information about the worksheet(s) imported. Hyperlink Cell determines which cell the hyperlink will appear in on the imported sheet(s).

Hyperlink Text

This is the text that will appear in the cell for users to click on. If the cell is specified and the text is not, the Active By sheet name will appear as the text.

Overwrite

If Overwrite is set to Yes and the Target Worksheet name exists in the workbook, it is deleted, and the new worksheet is inserted as the last worksheet tab in the Target Workbook.

If Overwrite is set to No and the worksheet name already exists in the workbook the name is reconfigured as Workbook Name-Target Sheet. If a sheet with that name exists, the worksheet is named Target Sheet (x) where x is a number starting at 2.

Example

To move an entire monthly June worksheet from workbook named Station_1_2020 and rename the June worksheet to ST_1 in a summary workbook the following settings would be used:

Setting

Value

Directory

C:\Reports

Workbook Name

Station_1_{YYYY}

Source Sheet

{MMMM}

Target Sheet

ST_1

Hyperlink Cell

Hyperlink Text

Overwrite

No