EventLinelist

Encapsulates workbook-level linelist events and lazily-cached domain managers. This class is the single entry point for all event handling in the output linelist workbook. It reacts to sheet change (HList geo cascades, editable labels, list auto, go-to-section, multiple choices; VList editable labels and multiple choices; analysis go-to-section and spatial dispatch), sheet deactivate (list auto update), selection change (geo dropdown refresh), double-click (spatio-temporal geo form), filter table updates, and list-auto dropdown maintenance.

Depends on: BetterArray, HiddenNames, DropdownLists, LLGeo, LLdictionary, LLVariables, LLTranslation, TranslationObject, ProjectError

Factory

Create #

Build a configured EventLinelist instance bound to a host workbook.

Signature:

Public Function Create(ByVal hostBook As Workbook) As IEventLinelist

Parameters:

  • hostBook: Workbook. The linelist workbook.

Returns: IEventLinelist. Configured service instance.

Throws:

  • ProjectError.ObjectNotInitialized When hostBook is Nothing.

IEventLinelist implementation

Configure #

Configure the service with its host workbook context.

Signature:

Public Sub Configure(ByVal hostBook As Workbook)

Parameters:

  • hostBook: Workbook. The linelist workbook.

Throws:

  • ProjectError.ObjectNotInitialized When hostBook is Nothing.

OnWorkbookOpen #

React to workbook open notifications.

Signature:

Public Sub OnWorkbookOpen()

OnSheetChange #

Handle worksheet change events.

Signature:

Public Sub OnSheetChange(ByVal sh As Worksheet, ByVal target As Range)

Parameters:

  • sh: Worksheet. The worksheet raising the change event.
  • target: Range. The edited cells.

OnSheetDeactivate #

Handle worksheet deactivation events.

Signature:

Public Sub OnSheetDeactivate(ByVal prevSheetName As String)

Parameters:

  • prevSheetName: String. Name of the sheet that was deactivated.

OnSelectionChange #

Handle selection change events on HList sheets.

Signature:

Public Sub OnSelectionChange(ByVal sh As Worksheet, ByVal target As Range)

Parameters:

  • sh: Worksheet. The worksheet where the selection changed.
  • target: Range. The newly selected cell(s).

OnDoubleClick #

Handle double-click events on analysis sheets.

Signature:

Public Sub OnDoubleClick(ByVal sh As Worksheet, ByVal target As Range)

Parameters:

  • sh: Worksheet. The worksheet where the double-click occurred.
  • target: Range. The double-clicked cell.

UpdateFilterTables #

Update filter tables used by analysis sheets.

Signature:

Public Sub UpdateFilterTables(Optional ByVal calculate As Boolean = True)

Parameters:

  • calculate: Optional Boolean. When True (default), recalculates the active sheet.

UpdateAllListAuto #

Update all list-auto dropdowns across all HList sheets.

Signature:

Public Sub UpdateAllListAuto()

ResetCaches #

Clear cached resources.

Signature:

Public Sub ResetCaches()

Internal members (not exported)

Factory

Self #

Current object instance cast to the interface.

Signature:

Public Property Get Self() As IEventLinelist

Returns: IEventLinelist. The current instance.


Private — HList change handler

HandleHListChange #

Handle value changes on HList sheets.

Signature:

Private Sub HandleHListChange(ByRef sh As Worksheet, ByRef target As Range, _
                              ByRef shHn As IHiddenNames)

Dispatches based on the target cell's position relative to the table: geo cascades (geo1-geo4 controls), editable labels (label row), list_auto flagging, go-to-section navigation, header protection (header row), and multiple choice updates.

Parameters:


Private — VList change handler

HandleVListChange #

Handle value changes on VList sheets.

Signature:

Private Sub HandleVListChange(ByRef sh As Worksheet, ByRef target As Range, _
                              ByRef shHn As IHiddenNames)

Handles editable label updates, multiple choice updates, and go-to-section navigation on vertical list sheets.

Parameters:


Private — Analysis change handler

HandleAnalysisChange #

Handle value changes on analysis sheets.

Signature:

Private Sub HandleAnalysisChange(ByRef sh As Worksheet, _
                                  ByRef target As Range, _
                                  ByRef analysisType As String)

Processes go-to-section navigation for all analysis types. For spatial analysis sheets, dispatches to GeoModule subs (UpdateSingleSpTable, DevideByPopulation, FormatDevidePop) based on named range patterns.

Parameters:


Private — Selection change handler

HandleSelectionHList #

Handle selection changes on HList sheets.

Signature:

Private Sub HandleSelectionHList(ByRef sh As Worksheet, ByRef target As Range, _
                                ByRef shHn As IHiddenNames)

Updates geo dropdown validation lists when the user navigates to a geo2, geo3, or geo4 cell.

Parameters:


Private — List auto helpers

UpdateListAutoSheet #

Update the list-auto dropdowns for a single sheet.

Signature:

Private Sub UpdateListAutoSheet(ByRef sh As Worksheet)

Checks the has_listauto flag to skip sheets without list-auto variables. Iterates header columns and updates dropdown lists from unique data values.

Parameters:


Private — Multiple choice helper

UpdateMultipleChoice #

Handle multiple choice dropdown value toggling.

Signature:

Private Sub UpdateMultipleChoice(ByRef target As Range, ByRef choiSep As String)

Parameters:


Private — Unique values helper

GetUniqueBA #

Return unique values from a BetterArray.

Signature:

Private Function GetUniqueBA(ByRef inputTable As BetterArray, _
                             Optional ByVal Sort As Boolean = False) As BetterArray

Parameters:

Returns: BetterArray. Array of unique values.


Private — Sheet metadata helpers

SheetTag #

Get the sheet type tag (HiddenNames first, cell fallback for analysis sheets).

Signature:

Private Function SheetTag(ByRef sh As Worksheet) As String

Parameters:

Returns: String. The sheet type tag (HList, VList, Uni-Bi-Analysis, etc.).


Private — Lazy initialisation

EnsureTranslation #

Lazily initialise translation, message translator, and hidden names.

Signature:

Private Sub EnsureTranslation()

EnsureDropdown #

Lazily initialise the dropdown manager.

Signature:

Private Sub EnsureDropdown()

EnsureGeo #

Lazily initialise the geo helper.

Signature:

Private Sub EnsureGeo()

EnsureDictionary #

Lazily initialise the dictionary and variables helpers.

Signature:

Private Sub EnsureDictionary()

EnsureVariables #

Lazily initialise the variables helper from the cached dictionary.

Signature:

Private Sub EnsureVariables()

SheetOrNothing #

Retrieve a worksheet from the host workbook or Nothing.

Signature:

Private Function SheetOrNothing(ByRef sheetName As String) As Worksheet

Parameters:

Returns: Worksheet. The worksheet, or Nothing when not found.


Private — Cache management

ResetInternalCaches #

Clear all lazily-cached domain managers.

Signature:

Private Sub ResetInternalCaches()

Private — Error handling

ThrowError #

Raise a ProjectError-based exception.

Signature:

Private Sub ThrowError(ByVal errNumber As Long, ByRef message As String)

Parameters:


Used in (4 file(s))