ISetupImportService
Defines the public contract for the SetupImportService class, exposing methods to validate, import, export, and clean setup worksheets between workbooks. Supports both table-level import (via CustomTable) and domain-class-driven import (via LLdictionary, LLChoices, LLExport, Analysis, SetupTranslationsTable).
Core operations
Check #
Validate the requested import operation before execution
Signature:
Public Sub Check(ByVal importDictionary As Boolean, _
ByVal importChoices As Boolean, _
ByVal importExports As Boolean, _
ByVal importAnalysis As Boolean, _
ByVal importTranslations As Boolean, _
Optional ByVal cleanSetup As Boolean = False)
Ensures at least one import option is selected, verifies the import path is configured and the file exists, then attempts to open and immediately close the source workbook to confirm it is readable.
Parameters:
importDictionary: Boolean. Flag requesting dictionary import.importChoices: Boolean. Flag requesting choices import.importExports: Boolean. Flag requesting exports import.importAnalysis: Boolean. Flag requesting analysis import.importTranslations: Boolean. Flag requesting translations import.cleanSetup: Optional Boolean. When True, performs a clean-only run. Defaults to False.
Import #
Perform the setup import from the configured workbook into the host workbook
Signature:
Public Sub Import(ByVal passwords As IPasswords, ByVal sheetsList As BetterArray)
Opens the source workbook, iterates over each requested sheet, matches ListObjects between source and host, and delegates import to CustomTable.Import. Handles sheet protection/unprotection and export column alignment via PrepareImport.
Parameters:
passwords: IPasswords. Password handler for worksheet protection.sheetsList: BetterArray. Worksheets participating in the import.
ImportFromWorkbook #
Perform the setup import leveraging dedicated worksheet classes
Signature:
Public Sub ImportFromWorkbook(ByVal passwords As IPasswords, Optional ByVal sheetsList As BetterArray = Nothing)
Uses domain-specific classes (LLdictionary, LLChoices, LLExport, Analysis, SetupTranslationsTable) to import each worksheet from the source workbook. Falls back to the default sheets list when none is provided.
Parameters:
passwords: IPasswords. Password handler for worksheet protection.sheetsList: Optional BetterArray. Worksheets to import. Defaults to Dictionary, Choices, Exports, Analysis, and Translations.
Export #
Export all setup worksheets to a new workbook
Signature:
Public Sub Export():End Sub
Creates or reuses an export workbook, then exports each setup worksheet (Dictionary, Choices, Exports, Analysis, Translations) using domain-specific managers, along with hidden names and formatting data.
Clean #
Clean target worksheets ahead of a fresh import
Signature:
Public Sub Clean(ByVal passwords As IPasswords, ByVal sheetsList As BetterArray)
Iterates over the requested sheets, unprotects each one, clears all ListObject data and worksheet comments, then re-protects.
Parameters:
passwords: IPasswords. Password handler for worksheet protection.sheetsList: BetterArray. Worksheets participating in the clean-up.
Configuration
Path #
Path to the source setup workbook
Signature:
Public Property Get Path() As String
Returns: String. The configured import path.
ProgressObject #
UI object receiving informational messages while the import runs
Signature:
Public Property Get ProgressObject() As Object
Returns: Object. The progress display object.
DisplayPrompts #
Toggle UI prompts displayed during operations
Signature:
Public Property Get DisplayPrompts() As Boolean
When False, suppresses folder-picker dialogs and other interactive prompts. Primarily used by automated tests.
Returns: Boolean. True when prompts are enabled.
SetExportFolder #
Provide an explicit folder for exports, bypassing the folder picker
Signature:
Public Sub SetExportFolder(ByVal folderPath As String)
Parameters:
folderPath: String. The folder path to use for exports.
Miscellaneous
LastExportFile #
Path of the last export produced by the service
Signature:
Public Property Get LastExportFile() As String
Returns the full file path of the last export workbook saved by the service. Returns an empty string when no export has occurred.
Returns: String. The last export file path, or empty.
Configuration
Path #
Store the path to the setup workbook
Signature:
Public Property Let Path(ByVal value As String)
Parameters:
value: String. The path to assign.
ProgressObject #
Assign the progress display object
Signature:
Public Property Set ProgressObject(ByVal value As Object)
Parameters:
value: Object. The progress display to store.
DisplayPrompts #
Assign the display prompts toggle
Signature:
Public Property Let DisplayPrompts(ByVal value As Boolean)
Parameters:
value: Boolean. True to enable prompts.
Miscellaneous
Self #
Current object instance
Signature:
Public Property Get Self() As ISetupImportService
Returns: ISetupImportService. The current instance cast to the interface.