ILinelist

Defines the public contract for the Linelist class, exposing worksheet accessors, collaborator getters, and lifecycle methods for creating, populating, saving, and error-managing the output linelist workbook.

Worksheets

Wksh #

Worksheet from the output workbook by name

Signature:

Public Property Get Wksh(ByVal sheetName As String) As Worksheet

Worksheet resolution by name with optional scope prefix. Returns the worksheet matching the given name from the output workbook. Raises an error if the sheet does not exist.

Parameters:

  • sheetName: String. The worksheet name to look up.

Returns: Worksheet. The resolved worksheet.


PrintWksh #

Printed companion worksheet by base name

Signature:

Public Property Get PrintWksh(ByVal sheetName As String) As Worksheet

Returns the printed companion worksheet (prefixed with "print_") from the output workbook. Used for HList sheets that have a printable duplicate.

Parameters:

  • sheetName: String. The base sheet name (without the print_ prefix).

Returns: Worksheet. The printed companion worksheet.


CRFWksh #

CRF companion worksheet by base name

Signature:

Public Property Get CRFWksh(ByVal sheetName As String) As Worksheet

Returns the CRF companion worksheet (prefixed with "crf_") from the output workbook. Used for case report form layouts.

Parameters:

  • sheetName: String. The base sheet name (without the crf_ prefix).

Returns: Worksheet. The CRF companion worksheet.


SheetExists #

Check whether a sheet exists in the output workbook

Signature:

Public Function SheetExists(ByVal sheetName As String) As Boolean

Tests whether a worksheet with the given name exists in the output workbook without raising an error. Uses On Error Resume Next internally.

Parameters:

  • sheetName: String. The worksheet name to test.

Returns: Boolean. True when the sheet exists, False otherwise.


AddOutputSheet #

Add a worksheet to the output workbook

Signature:

Public Sub AddOutputSheet(ByVal sheetName As String, _
                          Optional ByVal Hide As Long = xlSheetVeryHidden, _
                          Optional ByVal sheetScope As Byte = 1, _
                          Optional ByVal beforeSheet As String = vbNullString)

Creates a new worksheet in the output workbook with the given name, applying an optional scope prefix ("print_" or "crf_") and visibility setting. The sheet name is truncated to 30 characters. When beforeSheet is supplied and that sheet exists, the new sheet is inserted immediately before it.

Parameters:

  • sheetName: String. The base name for the new worksheet.
  • Hide: Optional Long. Excel visibility constant. Defaults to xlSheetVeryHidden.
  • sheetScope: Optional Byte. 1 = no prefix, 2 = print_ prefix, 3 = crf_ prefix. Defaults to 1.
  • beforeSheet: Optional String. Name of an existing worksheet to insert before. Defaults to vbNullString.

Collaborators

Dropdown lists manager for the output workbook

Signature:

Public Property Get Dropdown(Optional ByVal scope As Byte = 1) As IDropdownLists

Accessors for helper objects managed by the linelist. Returns an IDropdownLists instance backed by the appropriate list sheet. Scope 1 uses the temporary dropdown_lists__ sheet with "dropdown_" prefix; scope 2 uses the custom choice sheet with no prefix.

Parameters:

  • scope: Optional Byte. 1 = standard dropdowns, 2 = custom choice dropdowns. Defaults to 1.

Returns: IDropdownLists. The dropdown lists manager.


Pivots #

Pivot tables manager for the output workbook

Signature:

Public Property Get Pivots() As ICustomPivotTable

Returns an ICustomPivotTable instance backed by the translated custom pivot table sheet in the output workbook.

Returns: ICustomPivotTable. The pivot tables manager.


LinelistData #

Specifications backing this linelist

Signature:

Public Property Get LinelistData() As ILinelistSpecs

Returns the ILinelistSpecs instance that was supplied during factory construction, providing access to dictionary, choices, translations, and all other setup data.

Returns: ILinelistSpecs. The linelist specifications.


Dictionary #

Dictionary from the specifications

Signature:

Public Property Get Dictionary() As ILLdictionary

Convenience accessor that delegates to LinelistData.Dictionary.

Returns: ILLdictionary. The linelist dictionary.


Lifecycle

Prepare #

Build the full linelist output workbook from specifications

Signature:

Public Sub Prepare()

Build, save, and error-manage the output workbook. Orchestrates the complete linelist creation process: creates the output workbook (or opens a template), adds temporary sheets, prepares hidden names and ListObjects, exports specifications, adds analysis and data entry sheets, prepares the admin sheet, and transfers all VBA code components.


SaveLL #

Save the output workbook as .xlsb with password protection

Signature:

Public Sub SaveLL()

Saves the output workbook in .xlsb format with the configured password, protects the workbook structure, activates an appropriate visible sheet, closes the workbook, and cleans up temporary files.


ErrorManage #

Display an error dialog for incomplete linelist operations

Signature:

Public Sub ErrorManage(Optional ByVal textMessage As String = vbNullString)

Shows a message box with the error details and asks the user whether they want to view the incomplete linelist workbook or close it without saving.

Parameters:

  • textMessage: Optional String. Error description to display. Defaults to vbNullString.