ListBuilder

Builds horizontal (HList) or vertical (VList) data entry sheets for the linelist workbook. Each mode creates formatted sheets with freeze panes, sections via SectionBuilder, a GoTo-section dropdown, and worksheet protection. HList mode additionally creates a ListObject table, printed and filtered companion sheets, action buttons, and a pivot table. VList mode creates a PLAGEVALUES range reference for vertical data entry. Consumers call Create with a layer mode, sheet name, and linelist reference, then invoke Build to construct the sheet.

Depends on: ILinelist, ILLSheets, ILinelistSpecs, ILLFormat, IDropdownLists, IPasswords, ITranslationObject, IButtons, IHiddenNames, ISectionBuilder, ICustomPivotTables, BetterArray, Button shape codes

Version: 1.0 (2026-02-09)

Instantiation

create #

Create a ListBuilder instance

Signature:

Public Function Create(ByVal layer As Byte, _
                       ByVal sheetName As String, _
                       ByVal ll As ILinelist) As IListBuilder

Factory method and Friend bindings for construction. Creates a new ListBuilder wired to build a data entry sheet of the given layer type (HList or VList) for the named sheet within the linelist. The linelist object, sheet name, and presence in the dictionary are all validated before construction.

Parameters:

  • layer: Byte. The ListBuilderLayer mode (HList = 1, VList = 2).
  • sheetName: String. The dictionary sheet name to build.
  • ll: ILinelist. The linelist workbook facade providing worksheets, dropdowns, pivots, and specs.

Returns: IListBuilder. A fully initialised instance ready for Build.

Throws:

  • ProjectError.ObjectNotInitialized When ll is Nothing.
  • ProjectError.InvalidArgument When sheetName is empty or not present in the dictionary.

Core

build #

Build the data entry sheet

Signature:

Public Sub Build()

Public entry point for building the data entry sheet. Dispatches to the appropriate private builder based on the layer mode set during factory construction. HList mode delegates to BuildHList; VList mode delegates to BuildVList. Raises an error for unknown layer values.

Throws:

  • ProjectError.InvalidArgument When the layer value is not ListBuilderLayerHList or ListBuilderLayerVList.

Internal members (not exported)

Bindings

bin-layer #

Assign the builder layer mode

Signature:

Friend Property Let BinLayer(ByVal value As Byte)

Friend setters used only during factory construction.

Parameters:


bin-sheet-name #

Assign the target sheet name

Signature:

Friend Property Let BinSheetName(ByVal value As String)

Parameters:


bin-linelist #

Assign the linelist facade

Signature:

Friend Property Set BinLinelist(ByVal value As ILinelist)

Parameters:


HListBuild

build-hlist #

Build a horizontal data entry sheet

Signature:

Private Sub BuildHList()

Private implementation for horizontal data entry sheet construction. Constructs a full HList sheet: applies design formatting, freezes panes, adds action buttons (Show/Hide, Add Rows, Clear Filters, Open Print, and optionally Geo), builds sections via SectionBuilder, creates the GoTo section dropdown, stores sheet metadata as hidden names, creates the main ListObject table plus printed and filtered companion sheets, adds a pivot table, and protects the sheet. When a template workbook is in use, buttons are skipped and rows 3-4 are hidden instead.


VListBuild

build-vlist #

Build a vertical data entry sheet

Signature:

Private Sub BuildVList()

Private implementation for vertical data entry sheet construction. Constructs a VList sheet: applies design formatting, freezes pane row 1, builds sections via SectionBuilder, creates the GoTo section dropdown, stores sheet metadata as hidden names, computes the PLAGEVALUES range reference (the contiguous vertical data range starting at the table start marker), and protects the active sheet.


Helpers

build-sections #

Build sections using SectionBuilder

Signature:

Private Sub BuildSections(ByVal sh As Worksheet, ByVal printSh As Worksheet)

Private utilities shared by both build modes. Creates a SectionBuilder in the appropriate mode (HList or VList) and invokes its Build method. For HList mode, also retrieves the CRF companion worksheet (if it exists). Both standard and custom dropdown objects are passed to the builder for variable validation setup.

Parameters:


collect-section-names #

Collect section names for the GoTo dropdown

Signature:

Private Function CollectSectionNames(ByVal dict As ILLdictionary, _
                                     ByVal llshs As ILLSheets, _
                                     ByVal goToLabel As String) As BetterArray

Iterates through the dictionary rows for the current sheet, extracting unique section names in order. Each name is prefixed with the GoTo label (e.g., "Go to section: SectionName"). Duplicate consecutive sections are skipped to avoid redundant dropdown entries.

Parameters:

Returns: BetterArray. A 1-based array of prefixed section name strings.


throw-error #

Raise a ProjectError-based exception

Signature:

Private Sub ThrowError(ByVal errNumber As Long, ByVal errorMessage As String)

Parameters:


InterfaceImplementation

IListBuilder_Build #

Signature:

Private Sub IListBuilder_Build()

Delegated members satisfying the IListBuilder contract. See the corresponding Public members above for full documentation.


Used in (4 file(s))