LinelistBuildService
Orchestrates building a linelist by exporting pass-through components (dictionary, choices, exports, analysis, hidden names) directly from a setup workbook to the linelist workbook, eliminating the redundant designer intermediary copy. Designer-sourced components (geo, passwords, formatter when ribbon-imported, language HiddenNames, translations) are exported from the designer. After export, new domain manager instances targeting the linelist workbook are available via accessor properties. Replaces DesignerImportService for the generation flow.
Factory
Create #
create
Create and configure a linelist build service
Signature:
Public Function Create(Optional ByVal hostBook As Workbook = Nothing) As ILinelistBuildService
Factory method that creates a new LinelistBuildService instance, binds it to the supplied designer workbook, and returns the result through the ILinelistBuildService interface. When no workbook is provided, defaults to ThisWorkbook.
Parameters:
hostBook: Optional Workbook. The designer workbook. Defaults to ThisWorkbook.
Returns: ILinelistBuildService. A configured instance ready for use.
Public API
Configure #
configure
Bind the service to the designer workbook
Signature:
Public Sub Configure(ByVal hostBook As Workbook)
Parameters:
hostBook: Workbook. The designer workbook to operate on.
Throws:
- ProjectError.ObjectNotInitialized When the workbook is Nothing.
HostWorkbook #
host-workbook
The configured host workbook
Signature:
Public Property Get HostWorkbook() As Workbook
Returns: Workbook. The host workbook.
Throws:
- ProjectError.ObjectNotInitialized When the workbook was not configured.
ImportSetupToLinelist #
import-setup-to-linelist
Export pass-through components directly from setup to linelist
Signature:
Public Sub ImportSetupToLinelist(ByVal setupPath As String, ByVal targetBook As Workbook)
Opens the setup workbook at the supplied path (read-only), then exports dictionary, choices, exports, analysis, and hidden names directly into the target linelist workbook. Translations dictionary data is imported from setup into the designer's LinelistTranslation sheet (the full translations sheet is exported later in ExportDesignerComponents). The formatter is exported from setup when TAG_FORMATTER_IMPORTED is not set on the designer. The setup workbook is always closed on exit.
Parameters:
setupPath: String. Full path to the setup workbook.targetBook: Workbook. The linelist workbook to receive exported data.
Throws:
- ProjectError.SomethingWentWrong When setup cannot be opened or export fails.
ExportDesignerComponents #
export-designer-components
Export designer-sourced components to the linelist
Signature:
Public Sub ExportDesignerComponents(ByVal targetBook As Workbook)
Syncs language codes from Main sheet into designer HiddenNames, then exports designer HiddenNames, geo, passwords, translations, and formatter (when ribbon-imported) to the target linelist workbook.
Parameters:
targetBook: Workbook. The linelist workbook to receive exported data.
Throws:
- ProjectError.ObjectNotInitialized When targetBook is Nothing.
BuildExportedInstances #
build-exported-instances
Create domain manager instances from the exported linelist
Signature:
Public Sub BuildExportedInstances(ByVal targetBook As Workbook)
Creates new domain manager instances pointing to sheets in the target workbook. Each manager is created only when its corresponding sheet exists. Failures for individual managers are silently ignored so that remaining managers can still be created.
Parameters:
targetBook: Workbook. The linelist workbook containing exported data.
Internal members (not exported)
Factory
Self #
self
Current object instance
Signature:
Public Property Get Self() As ILinelistBuildService
Returns: ILinelistBuildService. The current instance cast to the interface.
Exported Instance Properties
ExportedDictionary #
exported-dictionary
Signature:
Public Property Get ExportedDictionary() As ILLdictionary
ExportedChoices #
exported-choices
Signature:
Public Property Get ExportedChoices() As ILLChoices
ExportedAnalysis #
exported-analysis
Signature:
Public Property Get ExportedAnalysis() As IAnalysis
ExportedExport #
exported-export
Signature:
Public Property Get ExportedExport() As ILLExport
ExportedGeo #
exported-geo
Signature:
Public Property Get ExportedGeo() As ILLGeo
ExportedPasswords #
exported-passwords
Signature:
Public Property Get ExportedPasswords() As IPasswords
ExportedTranslations #
exported-translations
Signature:
Public Property Get ExportedTranslations() As ILLTranslation
Setup-to-Linelist Export Helpers (Direct Path)
ExportDictionaryFromSetup #
export-dictionary-from-setup
Export dictionary directly from setup to linelist
Signature:
Private Sub ExportDictionaryFromSetup(ByVal setupBook As Workbook, ByVal targetBook As Workbook)
The data start row depends on the setup file format: .xlsb files have metadata rows above the data (row 5), while .xlsx files start at row 1. Exported sheet is set to very hidden.
ExportChoicesFromSetup #
export-choices-from-setup
Export choices directly from setup to linelist
Signature:
Private Sub ExportChoicesFromSetup(ByVal setupBook As Workbook, ByVal targetBook As Workbook)
ExportExportsFromSetup #
export-exports-from-setup
Export export specs directly from setup to linelist
Signature:
Private Sub ExportExportsFromSetup(ByVal setupBook As Workbook, ByVal targetBook As Workbook)
ExportAnalysisFromSetup #
export-analysis-from-setup
Export analysis directly from setup to linelist
Signature:
Private Sub ExportAnalysisFromSetup(ByVal setupBook As Workbook, ByVal targetBook As Workbook)
ExportHiddenNamesFromSetup #
export-hidden-names-from-setup
Export hidden names directly from setup to linelist
Signature:
Private Sub ExportHiddenNamesFromSetup(ByVal setupBook As Workbook, ByVal targetBook As Workbook)
ExportFormatterFromSetup #
export-formatter-from-setup
Export formatter from setup to linelist (when not ribbon-imported)
Signature:
Private Sub ExportFormatterFromSetup(ByVal setupBook As Workbook, ByVal targetBook As Workbook)
ImportTranslationsToDesigner #
import-translations-to-designer
Import dictionary translations from setup into designer sheet
Signature:
Private Sub ImportTranslationsToDesigner(ByVal setupBook As Workbook, ByVal hostBook As Workbook)
The LinelistTranslation sheet template lives on the designer workbook with all its ListObjects pre-populated. This method imports the dictionary translations from the setup file into the designer sheet. The full translations sheet is exported to the linelist later in ExportDesignerComponents via ExportTranslationsFromDesigner.
Designer-to-Linelist Export Helpers
ExportGeoFromDesigner #
export-geo-from-designer
Export geo from designer to linelist
Signature:
Private Sub ExportGeoFromDesigner(ByVal hostBook As Workbook, ByVal targetBook As Workbook)
Sets RNG_GeoLangCode and RNG_MetaLang on the designer's geo sheet before export so that UpdateLevelNames can resolve translations during ExportToWkb.
ExportPasswordsFromDesigner #
export-passwords-from-designer
Export passwords from designer to linelist
Signature:
Private Sub ExportPasswordsFromDesigner(ByVal hostBook As Workbook, ByVal targetBook As Workbook)
ExportTranslationsFromDesigner #
export-translations-from-designer
Export translations from designer to linelist
Signature:
Private Sub ExportTranslationsFromDesigner(ByVal hostBook As Workbook, ByVal targetBook As Workbook)
Exports the full LinelistTranslation sheet (all ListObjects including the just-updated dictionary translations) from the designer to the linelist workbook.
ExportFormatterFromDesigner #
export-formatter-from-designer
Export formatter from designer to linelist (when ribbon-imported)
Signature:
Private Sub ExportFormatterFromDesigner(ByVal hostBook As Workbook, ByVal targetBook As Workbook)
Language and HiddenNames Helpers
SyncDesignerLanguageNames #
sync-designer-language-names
Update language HiddenNames on the designer workbook from Main sheet values
Signature:
Private Sub SyncDesignerLanguageNames(ByVal hostBook As Workbook)
Reads the dictionary language from RNG_LangSetup and the interface language from RNG_LLForm on the Main worksheet. Writes these values as workbook-level HiddenNames (RNG_DictionaryLanguage and RNG_LLLanguageCode) on the host workbook so they are current before export. The interface language is split on "-" to extract the code prefix (e.g., "FRA-Francais" -> "FRA").
ExportDesignerHiddenNames #
export-designer-hidden-names
Export designer workbook HiddenNames to the target linelist workbook
Signature:
Private Sub ExportDesignerHiddenNames(ByVal hostBook As Workbook, ByVal targetBook As Workbook)
Copies all workbook-level HiddenNames from the designer (host) workbook to the target linelist workbook, including language codes, ribbon flags, and other configuration values.
Internal Helpers
FormatterAlreadyImported #
formatter-already-imported
Check whether the formatter was imported via the designer ribbon
Signature:
Private Function FormatterAlreadyImported(ByVal hostBook As Workbook) As Boolean
Returns: Boolean. True when TAG_FORMATTER_IMPORTED is "Yes" on the host workbook.
ResolveWorksheet #
resolve-worksheet
Resolve a worksheet by name from a workbook
Signature:
Private Function ResolveWorksheet(ByVal wb As Workbook, ByVal sheetName As String) As Worksheet
Returns: Worksheet. The resolved worksheet, or Nothing.
WorksheetExists #
worksheet-exists
Check whether a worksheet exists in a workbook
Signature:
Private Function WorksheetExists(ByVal wb As Workbook, ByVal sheetName As String) As Boolean
SetupStartRow #
setup-start-row
Return the data start row based on the setup file format
Signature:
Private Function SetupStartRow(ByVal wb As Workbook, ByVal xlsbRow As Long) As Long
Setup workbooks saved as .xlsb have metadata rows above the data tables (Dictionary at row 5, Choices/Exports at row 4). In .xlsx format the data always starts at row 1.
ReadMainRange #
read-main-range
Read a named range value from the Main worksheet
Signature:
Private Function ReadMainRange(ByVal wb As Workbook, ByVal rngName As String) As String
Returns: String. Cell value or vbNullString.
CloseWorkbook #
close-workbook
Close a workbook safely without raising errors
Signature:
Private Sub CloseWorkbook(ByRef wb As Workbook)
ValidateFilePath #
validate-file-path
Validate that a file path is not empty and the file exists
Signature:
Private Sub ValidateFilePath(ByVal filePath As String)
ClearExportedInstances #
clear-exported-instances
Reset all exported domain manager references
Signature:
Private Sub ClearExportedInstances()
ThrowError #
throw-error
Raise a ProjectError-based exception
Signature:
Private Sub ThrowError(ByVal errorCode As ProjectError, ByVal messageText As String)
Interface Implementation
ILinelistBuildService_Configure #
Signature:
Private Sub ILinelistBuildService_Configure(ByVal hostBook As Workbook)
Delegated members satisfying the ILinelistBuildService contract.