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, list-auto dropdown maintenance, and geo/spatial UDF delegation.

Depends on: BetterArray, HiddenNames, DropdownLists, LLGeo, LLSpatial, LLdictionary, LLVariables, LLTranslation, TranslationObject, Passwords, LLLog, FilteredData, ProjectError

Factory

Create #

Build a configured EventLinelist instance bound to a host workbook.

Signature:

Public Function Create(ByVal hostBook As Workbook) As EventLinelist

Parameters:

  • hostBook: Workbook. The linelist workbook.

Returns: EventLinelist. Configured service instance.

Throws:

  • ProjectError.ObjectNotInitialized When hostBook is Nothing.

Public operations

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()

The open is the first line of the session in the user log, so a reader of the log sees where each working session started.

The workbook opens on the sheet it was saved on, and a linelist saved by the generation lands on Geo. LandOnInstructions puts the user on the instruction sheet instead, every open.

The pointer is parked on the north-west arrow at open. That arrow is the cursor every busy state of the session shows, and ApplicationState restores the cursor it snapshots, so with the standing cursor equal to the busy one an event leaves no visible pointer change. The snapshot used to hold the default cursor, and every selection on a data entry sheet flicked the pointer twice.


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 prevsh As Worksheet)

The handler is written into the code module of each HList sheet, so the sheet that was left arrives as an object and its own flag is all this reads.

Rebuilding an automatic list means reading a whole column, uniquing it and writing a table, per list, and it is far too slow to do on the way out of every sheet. It happens only when something the lists depend on was edited on THIS sheet, which is what the flag records and what the sheet-change handler raises. A sheet nobody touched costs one hidden-name read on the way out.

Parameters:

  • prevsh: Worksheet. 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)

The sheet is an HList sheet by construction. Worksheet_SelectionChange is written into the code module of the HList sheets alone, so a "sheet_type" read here can only ever answer HList, and it cost a walk of the sheet Names collection on every arrow key. The handler below wants the store, and reads the held one.

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 Function OnDoubleClick(ByVal sh As Worksheet, ByVal target As Range) As Long

Answers the geo scope whose picker the double-click asked for, and GEOSCOPENONE when the click asked for no picker at all. The caller is what opens the picker: the form lives in the workbook and a class cannot reach it.

Parameters:

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

Returns: Long. GeoScopeAdmin, GeoScopeHF, or GEOSCOPENONE.


UpdateFilterTables #

Update filter tables used by analysis sheets.

Signature:

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

FilteredData does the walk and the rewrite: every filtered table is written from the visible rows of its source table that hold a value. The class is the measured home of that work, and the filtered export runs the same code, so one algorithm answers both callers.

A sheet the sync could not place is skipped and named. The walk finishes the remaining sheets and the box at the foot lists each skipped sheet with its reason, which is what a user needs to repair the workbook.

FilteredData writes the failure line of the run to the user log, so the box here goes straight through ShowMessage and the log keeps one line per failed refresh.

The recalculation at the foot is one pass: the sheet pass covers the UsedRange and column passes that used to follow it.

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()

RecalculateGeoColumns #

Recalculate every cell whose formula reads the geobase.

Signature:

Public Sub RecalculateGeoColumns()

A geobase import rewrites the Geo sheet while the workbook runs on manual calculation, so the cells built on it keep the values of the geobase before. Three families of cells do: the concat columns of the data entry sheets, the p-code columns beside them, and the four admin level labels the spatial analysis dropdowns list. The geobase import handler calls this once the Geo sheet is rewritten and the caches are dropped.

The label cells matter twice over. They are what the dropdown shows, and LLGeo.AdminCode matches the picked label against the fresh level names, so a stale label resolves to no level and stops every admin level change on the sheet.


Translation #

The one translation helper of the workbook.

Signature:

Public Function Translation() As LLTranslation

The button, ribbon and geo modules each used to build their own. LLTranslation validates all five tables on Create and caches every scope it is asked for until Refresh, so one instance answers all four callers for the price of the first build, and Refresh then has one place to be called from. A module reaches this through LinelistEventsManager.EventLinelistService.

Returns: LLTranslation. The held helper, or Nothing when the workbook carries no usable translation sheet.


WorkbookNames #

The hidden names of the workbook, built once and held.

Signature:

Public Function WorkbookNames() As HiddenNames

The button module used to build its own on every click, and a workbook store costs a walk of the whole Names collection.

Returns: HiddenNames. The held store, or Nothing when the build failed.


SheetNames #

The hidden names of one worksheet, built once and held.

Signature:

Public Function SheetNames(ByVal sh As Worksheet) As HiddenNames

One store serves the event handlers and the buttons together, and the class drops it when that sheet raises a change. The button module read a sheet tag, a table name and a blank row count through three separate stores.

Parameters:

  • sh: Worksheet. The worksheet whose names are wanted.

Returns: HiddenNames. The held store, or Nothing when the build failed.


PasswordManager #

The password manager of the workbook, built once and held.

Signature:

Public Function PasswordManager() As Passwords

Returns: Passwords. The held manager, or Nothing when the build failed.


UserLog #

The user log of the workbook, built once and held.

Signature:

Public Function UserLog() As LLLog

The dated record of the user actions, kept on the very hidden log worksheet. Fail and Warn write their line through it, and the button and form modules write their outcome lines through it. An old linelist grows the log sheet on the first logged event.

Returns: LLLog. The held log, or Nothing when the build failed.


Dictionary #

The dictionary of the linelist, built once and held.

Signature:

Public Function Dictionary() As LLdictionary

The variable-labels button used to build a dictionary per click, and creating one walks the whole Dictionary worksheet. A workbook with no Dictionary sheet answers Nothing, and the tried flag keeps the failed build from repeating.

Returns: LLdictionary. The held dictionary, or Nothing when the build failed.


Variables #

The variable reader of the dictionary, built once and held.

Signature:

Public Function Variables() As LLVariables

Returns: LLVariables. The held reader, or Nothing when the build failed.


GeoManager #

The geobase manager of the workbook, built once and held.

Signature:

Public Function GeoManager() As LLGeo

The geo and form modules used to build one each, and LLGeo.Create walks two whole Names collections per build. A held instance also caches the five admin level labels, so anything that rewrites the Geo sheet has to be followed by ResetCaches for the labels to be read again. HandleImportGeobase already does that on both its paths.

Returns: LLGeo. The held manager, or Nothing when the build failed.


VarLabelTable #

The table the variable-labels form shows.

Signature:

Public Function VarLabelTable() As BetterArray

One row per hlist2D variable: the pivot block title of its table, the variable name and the main label. The pivot titles are worksheet hidden names CustomPivotTable writes on the custom pivot sheet, and that sheet is reached through the workbook hidden name RNG_CustomPivot. A workbook where the dictionary or the pivot sheet cannot be read answers what it can: an empty table, or rows with empty titles.

The rows are built in memory. The button used to stage them on the __temp worksheet and read them back, one Excel crossing per cell.

Returns: BetterArray. One item per variable, each an array of title, name and label.


ResetCaches #

Clear cached resources.

Signature:

Public Sub ResetCaches()

Messages

Warn #

Tell the user why a button refused to act.

Signature:

Public Sub Warn(ByVal msgCode As String, _
                Optional ByVal source As String = vbNullString)

The refusal is also one warning line of the user log, written before the box shows. Every refusal box of the button, ribbon and geo modules comes through here, so the log covers them all through this one edit. The line carries the sentence the user was shown, in the language they were shown it in, and the procedure that refused. It used to carry the message CODE as the action and nothing else, so a log read weeks later said "MSG_SectionTitleCell" and named neither the reason nor the button.

Parameters:

  • msgCode: String. Code of the message in the message translation table.
  • source: String. Optional. The procedure raising the refusal.

Fail #

Tell the user an operation failed.

Signature:

Public Sub Fail(ByVal msgCode As String, _
                Optional ByVal detail As String = vbNullString, _
                Optional ByVal fallback As String = vbNullString, _
                Optional ByVal source As String = vbNullString, _
                Optional ByVal logDetail As String = vbNullString)

The failure is also one failure line of the user log, written before the box shows. Every failure box of the button, ribbon and geo modules comes through here, so the log covers them all through this one edit. The line reads as the box did: the translated sentence, then the detail behind it, and the procedure that failed in front. A reason meant for the log alone goes in logDetail. A raw Err.Description is worth having in a log a user sends on and is worth little inside a box on a field machine, and several handlers have a reason of exactly that kind.

Parameters:

  • msgCode: String. Code of the message in the message translation table.
  • detail: String. Optional. Follows the message in the box AND the log.
  • fallback: String. Optional. Shown when the workbook carries no usable translation sheet. Leave it off to stay quiet in that state.
  • source: String. Optional. The procedure raising the failure.
  • logDetail: String. Optional. Follows the message in the log alone.

Geo / Spatial UDF delegation

GeoConcat #

Concatenate geo cells up to a given admin level.

Signature:

Public Function GeoConcat(ByVal cellRng As Range, ByVal geoLevel As Byte) As String

Parameters:

  • cellRng: Range. The first geo cell.
  • geoLevel: Byte. Number of admin levels to concatenate (1-4).

Returns: String. Pipe-delimited concatenation of non-empty admin values.


BareSpatialName #

Take the authored spatial tag off a variable name.

Signature:

Public Function BareSpatialName(ByVal varName As String) As String

The spatial formulas carry the dictionary variable the tables were summed over -- "concat_adm" in front of a geographic name, "hf" in front of a facility one -- and the spatial tables are keyed on the bare name. The tag comes off whole, so a bare name carrying underscores of its own survives; a name with no tag passes through unchanged, and the table lookup then answers its usual empty string.

The geographic tag is matched at every level. The formulas are authored on the adm1 spelling, and LLSpatial.ChangeAdminLevel rewrites the level inside the quoted argument when the user picks another one. The strip used to know "concat_adm1_" alone, so the first level change left the tag on, the table lookup missed, and FindTopAdmin answered nothing for the rest of the session.

Parameters:

  • varName: String. Variable name as the formula carries it.

Returns: String. The bare variable name.


TopAdmin #

Return the top admin name for a spatial variable.

Signature:

Public Function TopAdmin(ByVal adminLevel As String, _
                         ByVal adminOrder As Integer, _
                         ByVal varName As String, _
                         Optional ByVal tabId As String = vbNullString) As String

Parameters:

  • adminLevel: String. The level label as the dropdown carries it (e.g. "District").
  • adminOrder: Integer. Rank order (1 = top, 2 = second, etc.).
  • varName: String. Variable name (with prefix, e.g. "concat_adm1_myvar").
  • tabId: Optional String. Spatial table identifier.

Returns: String. Admin name at the given rank.


TopPop #

Return the population for the top admin of a spatial variable.

Signature:

Public Function TopPop(ByVal adminLevel As String, _
                       ByVal adminOrder As Integer, _
                       ByVal varName As String, _
                       Optional ByVal tabId As String = vbNullString) As Long

Parameters:

  • adminLevel: String. The level label as the dropdown carries it (e.g. "District").
  • adminOrder: Integer. Rank order (1 = top, 2 = second, etc.).
  • varName: String. Variable name (with prefix "concat_adm1_").
  • tabId: Optional String. Spatial table identifier.

Returns: Long. Population count at the given rank.


TopHF #

Return the top health facility name for a spatial variable.

Signature:

Public Function TopHF(ByVal adminOrder As Integer, _
                      ByVal varName As String, _
                      Optional ByVal tabId As String = vbNullString) As String

Parameters:

  • adminOrder: Integer. Rank order (1 = top, 2 = second, etc.).
  • varName: String. Variable name (with "hf_" prefix).
  • tabId: Optional String. Spatial table identifier.

Returns: String. Health facility name at the given rank.


Internal members (not exported)

Public operations

LandOnInstructions #

Put the user on the instruction sheet.

Signature:

Private Sub LandOnInstructions()

The sheet is named by the translation, and the generation moves it to the front of the workbook, so the first visible worksheet is the same sheet whenever the name cannot be read. A workbook built with the instructions turned off carries the sheet very hidden, and the fallback then lands on the first sheet the user is meant to see rather than on Geo.

Nothing here is worth an error box on open. Every step is guarded and a workbook that answers none of them opens where it was saved.


RecalculateGeoColumnsOfSheet #

Recalculate the geobase columns of one data entry sheet.

Signature:

Private Sub RecalculateGeoColumnsOfSheet(ByVal sh As Worksheet)

Walks the header row of the data table and recalculates the data body of every concat and p-code column. The concat columns go first: the p-code lookups match on them. A sheet with no table or no data row is left alone.

Parameters:


Messages

MessageText #

The sentence one message code stands for.

Signature:

Private Function MessageText(ByVal msgCode As String) As String

The same reading ShowMessage makes, so the log line and the box say the same thing. A workbook with no usable translation sheet, and a code the table has no row for, both answer the code itself: a log naming a code is worth more than a log naming nothing.

Parameters:

Returns: String. The translated sentence, or the code.


JoinedDetail #

Put the detail behind the message, the way the box does.

Signature:

Private Function JoinedDetail(ByVal message As String, _
                              ByVal detail As String) As String

Parameters:

Returns: String. The two joined, or the message alone.


ShowMessage #

Show one box, translated when a translator is there.

Signature:

Private Sub ShowMessage(ByVal msgCode As String, _
                        ByVal boxStyle As Long, _
                        ByVal detail As String, _
                        ByVal fallback As String)

A workbook with no usable translation sheet has no text to show, and the callers that still have something to say pass a fallback. Every other caller stays quiet, which is what the two boxes this replaced did.


LogEventLine #

Write one line of the user log.

Signature:

Private Sub LogEventLine(ByVal scope As Byte, _
                         ByVal action As String, _
                         ByVal detail As String, _
                         Optional ByVal source As String = vbNullString)

A log write must never take down the box or the walk it records, so a workbook whose log cannot be built stays quiet and a write that raises is swallowed here.

Parameters:


Geo / Spatial UDF delegation

RecordedAdminCode #

The admin level a spatial table's formulas stand on.

Signature:

Private Function RecordedAdminCode(ByVal tabId As String) As String

The dropdown label is the first source of the level and this cell is the second. A freshly generated table carries the "select a level" prompt in its dropdown, a user can clear the dropdown with Delete, and a geobase re-imported in another language leaves the cell holding a label no level answers to. In all three the label resolves to nothing while this cell still records the level the formulas of that table were last written against, so the reads stay on the level the sheet is actually showing.

Parameters:

Returns: String. The recorded admin code, or an empty string when the table carries no such cell.


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 HiddenNames)

Dispatches on the position of the edited cell, cheapest and most specific test first, and every branch exits. An edit inside the table recalculates its own row and goes to the geo cascade, the list-auto flag or the multiple choice toggle; an edit on the label row updates the editable label; an edit on the go-to cell navigates to the chosen section; an edit on the header row is refused and the cell restored.

THE GO-TO TEST READS THE FIRST CELL AND THE SHEET STORE

The builder puts the go-to dropdown in the first cell of the sheet and stores its caption in the sheet store under

_go_to_section. Resolving that id as a range name raised 1004 on every sheet the builder makes, because the id names a stored string; the raise landed on the error label, so the header protection and the multiple choice toggle below the old block never ran.

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 HiddenNames)

Dispatches on the column of the edited cell and every branch exits. An edit in the label column updates the editable label; an edit in the value column recalculates the value block once and runs the multiple choice toggle when the control asks for it; an edit on the go-to cell navigates to the chosen label. The value block used to be recalculated on every edit of the sheet, above the dispatch, so a label edit and a navigation both paid for it.

The go-to test reads the first cell of the sheet and the caption the sheet store carries, the same way the HList handler does.

Parameters:


MoveToCell #

Move the window to one cell and select it.

Signature:

Private Sub MoveToCell(ByVal cellRng As Range)

Range.Activate selects a cell and leaves the window where it is whenever the cell is already inside the visible pane. On a data entry sheet forty columns wide, the section a user picks in the go-to dropdown is usually just off the edge, so the selection moved and the picture did not: the dropdown looked as though it had done nothing.

Application.Goto with Scroll scrolls the pane so the cell is at its top left, which is what "go to" means to the person who picked it.

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, three dispatch methods (UpdateSingleSpTable, DevideByPopulation, FormatDevidePop) read what changed and hand the formula work to LLSpatial, based on named range patterns.

Parameters:


Private -- Spatial table update handlers

UpdateSingleSpTable #

Move a spatial table to the admin level the user picked.

Signature:

Private Sub UpdateSingleSpTable(ByVal rngName As String)

Reads the dropdown, turns its label into an admin code through the held LLGeo, and hands the formula rewriting to LLSpatial, which keeps each formula's array state. Busy state is managed by the calling LinelistEventsManager. The sheet protection is restored on every path, raise included.

A label naming no level stops the whole thing here. Data validation checks what a user types or picks and says nothing about Delete, so an emptied dropdown reaches this sub as a Change like any other. Running on it would rewrite every concat_adm in the block to concat_ and then record the empty level, which leaves the table reading a column that does not exist with nothing left on the sheet saying where it came from.

Parameters:


DevideByPopulation #

Divide or revert all computed values by the population.

Signature:

Private Sub DevideByPopulation(ByVal rngName As String, _
                               Optional ByVal revertBack As Boolean = False)

Reads the admin dropdown of the table, turns its label into an admin code through the held LLGeo, and hands the formula arithmetic to LLSpatial. The sheet protection is restored on every path, raise included.

A label naming no level stops the whole thing here, for the same reason it stops UpdateSingleSpTable: the population column of an empty level is a column that does not exist, and dividing by it puts an error in every cell of the block that the revert then cannot read its way back out of.

Parameters:


FormatDevidePop #

Toggle population division formatting.

Signature:

Private Sub FormatDevidePop(ByVal rngName As String)

Reads the divide/no-divide dropdown against the two translated labels of the workbook store, hands the cell formatting to LLSpatial, then delegates to DevideByPopulation to apply or remove the formula modifications. The sheet protection is restored on every path, raise included.

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 HiddenNames)

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

Parameters:


Private -- List auto helpers

UpdateListAutoSheet #

Update the automatic lists of a single sheet.

Signature:

Private Sub UpdateListAutoSheet(ByRef sh As Worksheet)

Checks the has_listauto flag to skip sheets that carry none, then walks the header row and rebuilds the automatic list of every DIRECT origin from the values entered under it.

ONLY A DIRECT ORIGIN IS COLLECTED FROM

The "list auto" column of the dictionary carries two tags. A direct origin is named in the control details of a list_auto variable, and its column is what the automatic list holds. An indirect origin only feeds a formula a direct origin is built on; it is watched, because an edit to it can move what the direct origin computes, and it is never collected from. Both tags used to be read as one, so an ordinary choice column that happened to feed such a formula had its dropdown rebuilt out of whatever had been typed under it.

THE LIST HAS ITS OWN TABLE

The table rebuilt here is the origin''s name plus the suffix, which is the name VarWriter gave it and the name the list_auto cells validate against. The origin''s own dropdown, when it has one, is a different table and is left alone.

NOTHING IS CLEARED BEFORE THE REPLACEMENT IS IN HAND

An empty column ends the walk for that variable. Clearing first and writing after left the table empty whenever the new values came to nothing, and a ListObject cannot hold no data row at all, so the list came back offering one blank entry.

Parameters:


Private -- Multiple choice helper

UpdateMultipleChoice #

Handle multiple choice dropdown value toggling.

Signature:

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

The toggle needs the value the cell held before the edit. That comes from the held copy RememberCellValue keeps, filled when the user lands on the cell and refreshed after every edit. The undo stack is the fallback for a cell the session has no reading for -- it costs a round trip per call, which on a multiple choice column is a round trip per keystroke.

Parameters:


Private -- Previous value capture

RememberCellValue #

Hold the value of one cell for the next edit to it.

Signature:

Private Sub RememberCellValue(ByRef target As Range)

OnSelectionChange stores the value found under the selection, and OnSheetChange stores what the cell holds once its handlers have run. A selection of several cells drops the held reading, because one value can stand for one cell only.

Parameters:


CellKey #

The identity of one cell, as sheet name and address.

Signature:

Private Function CellKey(ByRef target As Range) As String

Parameters:

Returns: String. Sheet name and address joined with an exclamation mark.


Private -- Unique values helper

GetUniqueBA #

Return unique values from a BetterArray.

Signature:

Private Function GetUniqueBA(ByRef inputTable As BetterArray) As BetterArray

The array built here goes to the caller as it stands. Each call used to answer a Clone, which copied every unique value once per list-auto column per sheet deactivate.

Parameters:

Returns: BetterArray. Array of unique values.


Private -- Sheet metadata helpers

SheetTag #

Get the sheet type tag from worksheet-level HiddenNames.

Signature:

Private Function SheetTag(ByRef sh As Worksheet) As String

The quick read is what this wants. It used to build a whole HiddenNames store for one value, and UpdateAllListAuto calls it once per worksheet of the workbook, so every sheet in the loop paid a full walk of its own Names collection.

Parameters:

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


Private -- Lazy initialisation

EnsureWorkbookNames #

Lazily initialise the workbook-level hidden names.

Signature:

Private Sub EnsureWorkbookNames()

This used to sit at the foot of EnsureTranslation, below two early exits. A workbook with no LinelistTranslation sheet took the exit at that sheet lookup and never reached the line, so this.wkbNames stayed Nothing for the whole session: RNG_GoToSection was never read and go-to-section did nothing on every sheet, with no message. The store has nothing to do with the translation tables, so it is built on its own.


EnsureTranslation #

Lazily initialise the translation helper and the message translator.

Signature:

Private Sub EnsureTranslation()

A translation sheet missing a table, or a workbook whose language code is empty, leaves the two fields Nothing and every event that needs them does nothing. The suppression is kept for that reason: an event handler has nothing above it to catch a raise. A workbook in that state costs the events their labels and leaves everything else working.


EnsureDropdown #

Lazily initialise the dropdown manager.

Signature:

Private Sub EnsureDropdown()

EnsureGeo #

Lazily initialise the geo helper.

Signature:

Private Sub EnsureGeo()

EnsureSpatial #

Lazily initialise the spatial helper.

Signature:

Private Sub EnsureSpatial()

EnsurePasswords #

Lazily initialise the password manager.

Signature:

Private Sub EnsurePasswords()

EnsureLog #

Lazily initialise the user log.

Signature:

Private Sub EnsureLog()

Growing the log sheet on an old linelist wants the workbook structure unprotected, so the build unprotects around Create when the sheet is missing and protects back after. The password manager is Nothing on a workbook with no password worksheet, and such a workbook is unprotected anyway.


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()

SheetStore #

The hidden names of one worksheet, built once and held.

Signature:

Private Function SheetStore(ByRef sh As Worksheet) As HiddenNames

Keyed on the sheet name in a Collection. Scripting.Dictionary is missing on Mac Excel and LLFormat holds its three caches the same shape. The store of a sheet costs a walk of that sheet's Names collection, and the selection handler asks for one on every arrow key.

Parameters:

Returns: HiddenNames. The held store, or Nothing when the build failed.


DropSheetStore #

Forget the held store of one worksheet.

Signature:

Private Sub DropSheetStore(ByRef sheetName As String)

Parameters:


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()

The tried flags go with the fields. A flag left standing turns this into a permanent refusal to build the manager again.


Private -- Error handling

ThrowError #

Raise a ProjectError-based exception.

Signature:

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

Parameters:


Used in (29 file(s))
  • AnalysisOutput.cls
  • LLGeo.cls
  • LLSpatial.cls
  • Linelist.cls
  • LLDataEntry.cls
  • VarWriter.cls
  • ShowHideStore.cls
  • CustomLinelistFunctions.bas
  • EventLinelistWorkbook.bas
  • EventsLinelistButtons.bas
  • EventsLinelistRibbon.bas
  • GeoModule.bas
  • ImportChecking.bas
  • LinelistEventsManager.bas
  • FormLogicAdvanced.bas
  • FormLogicEpiWeek.bas
  • FormLogicExport.bas
  • FormLogicExportMig.bas
  • FormLogicGeo.bas
  • FormLogicImportRep.bas
  • FormLogicShowHide.bas
  • FormLogicShowHidePrint.bas
  • FormLogicShowHideSave.bas
  • FormLogicShowHideSections.bas
  • FormLogicShowVarLabels.bas
  • TestLLGeo.bas
  • GeoTestFixture.bas
  • TestEventLinelist.bas
  • TestEventLinelistSheets.bas