ILLImporter
Defines the public contract for the LLImporter class, exposing methods to import linelist data from external workbooks. Supports importing HList/VList data, custom dropdowns, show/hide state, editable labels, single values, and geobase data. Also provides an import report that tracks which sheets and variables were not imported or not touched.
Data Checks
HasData #
Whether the workbook contains user-entered data
Signature:
Public Property Get HasData() As Boolean
Scans all HList sheets for non-empty rows beyond the blank count threshold stored in cell(1,6). Returns True as soon as a single HList row has user data. Used to warn the user before clearing or overwriting.
Returns: Boolean. True when at least one HList row has user data.
HasSameLanguage #
Check whether the import workbook language matches
Signature:
Public Function HasSameLanguage(ByVal impwb As Workbook) As Boolean
Reads the language tag from the import workbook Metadata sheet and compares it with the source workbook dictionary language. Stores the result internally so that ImportShowHide, ImportEditableLabels, and ImportSingleValues silently skip when languages differ.
Parameters:
impwb: Workbook. The opened import workbook.
Returns: Boolean. True when languages match.
Data Operations
ClearData #
Clear all user-entered data from HList and VList sheets
Signature:
Public Sub ClearData()
Iterates over all worksheets in the source workbook, clearing non-formula cell values from HList ListObjects and VList named ranges. Unprotects and re-protects each sheet via IPasswords.
ImportData #
Import data from HList and VList worksheets
Signature:
Public Sub ImportData(ByVal impwb As Workbook, ByVal pasteAtBottom As Boolean)
Iterates over the import workbook worksheets, matching them to source workbook sheets by name. For HList sheets, delegates to CustomTable.Import. For VList sheets, copies named range values. Tracks imported sheets and variables, and builds "not imported" report entries for unmatched items.
Parameters:
impwb: Workbook. The opened import workbook.pasteAtBottom: Boolean. When True, appends data below existing rows.
ImportCustomDropdown #
Import custom dropdown choices from the import workbook
Signature:
Public Sub ImportCustomDropdown(ByVal impwb As Workbook, ByVal pasteAtBottom As Boolean)
Reads custom dropdown ListObjects from the source workbook custom dropdown sheet, matches them to choices in the import workbook Choices sheet, and updates each dropdown with the imported values. Silently exits when the import workbook has no Choices sheet or no custom dropdown sheet exists.
Parameters:
impwb: Workbook. The opened import workbook.pasteAtBottom: Boolean. When True, appends choices below existing entries.
Migration Metadata
ImportShowHide #
Import show/hide visibility state from a migration workbook
Signature:
Public Sub ImportShowHide(ByVal impwb As Workbook)
Reads the show_hide_migration ListObject from the import workbook and applies visibility and column/row sizes to each data sheet via ShowHideManager. Silently skips when HasSameLanguage returned False, or when the import workbook lacks the required Metadata or show_hide__ sheets, or when the metadata tag is not set to "update on import".
Parameters:
impwb: Workbook. The opened migration workbook.
ImportEditableLabels #
Import editable label values from a migration workbook
Signature:
Public Sub ImportEditableLabels(ByVal impwb As Workbook)
Reads the import workbook dictionary for editable label values and updates both the worksheet cells and dictionary entries in the source workbook. Silently skips when HasSameLanguage returned False, the import dictionary is not prepared, or the metadata tag is not set to "update on import".
Parameters:
impwb: Workbook. The opened migration workbook.
ImportSingleValues #
Import single metadata values from a migration workbook
Signature:
Public Sub ImportSingleValues(ByVal impwb As Workbook)
Reads epiweek start and other single values from the import workbook Metadata sheet and updates the corresponding named ranges in the source workbook. Silently skips when HasSameLanguage returned False.
Parameters:
impwb: Workbook. The opened migration workbook.
ImportGeobase #
Import geobase data from a workbook
Signature:
Public Sub ImportGeobase(ByVal impwb As Workbook, Optional ByVal histoOnly As Boolean = False)
Delegates to LLGeo.Import to load geobase data. When not histoOnly, also updates geobase headers in HList worksheets, dictionary geo labels, and show/hide tables for geo variables.
Parameters:
impwb: Workbook. The opened geobase workbook.histoOnly: Optional Boolean. When True, imports only historic geobase data. Defaults to False.
Import Report
NeedReport #
Whether the last import had issues
Signature:
Public Property Get NeedReport() As Boolean
Returns True when at least one report entry exists, meaning some sheets or variables were not imported or not touched during the last import.
Returns: Boolean. True when the import report has entries.
FinalizeReport #
Build the "not touched" part of the import report
Signature:
Public Sub FinalizeReport()
Compares source workbook sheets and variables against imported items to find which ones were not touched by the import. Skips formula-type variables (case_when, formula, choice_formula). Call after ImportData.
ReportSheets #
Report sheet names for the given scope
Signature:
Public Function ReportSheets(ByVal scope As Byte) As BetterArray
Returns a BetterArray of sheet names that were either not imported (ImportReportNotImported) or not touched (ImportReportNotTouched). Returns an empty BetterArray when no entries exist for the scope.
Parameters:
scope: Byte. ImportReportNotImported or ImportReportNotTouched.
Returns: BetterArray. Sheet names matching the scope, or empty.
ReportVariables #
Report variable entries for the given scope
Signature:
Public Function ReportVariables(ByVal scope As Byte) As BetterArray
Returns a BetterArray where each entry is a Variant array of Array(variableName, sheetName). Returns an empty BetterArray when no entries exist for the scope.
Parameters:
scope: Byte. ImportReportNotImported or ImportReportNotTouched.
Returns: BetterArray. Variant arrays of (variableName, sheetName), or empty.
ClearReport #
Reset report state
Signature:
Public Sub ClearReport()
Clears all report tracking arrays and resets the needReport flag. Call before starting a new import session to ensure a clean report.