DiseaseExportWorkbook

Internal members (not exported)

Factory

Create #

Build a fresh manager holding no workbook yet.

Signature:

Public Function Create() As DiseaseExportWorkbook

Returns: DiseaseExportWorkbook ready to hand out a workbook on demand.


Lifecycle

EnsureWorkbook #

Ensure a workbook instance is available for exports.

Signature:

Public Function EnsureWorkbook(ByVal excelApp As Application) As Excel.Workbook

Parameters:

Returns: Workbook ready for export operations.


SaveAs #

Persist the workbook to disk.

Signature:

Public Sub SaveAs(ByVal filePath As String, _
                  Optional ByVal fileFormat As Long = xlOpenXMLWorkbook, _
                  Optional ByVal createBackup As Boolean = False)

Parameters:


CloseWorkbook #

Close the workbook and clear the reference.

Signature:

Public Sub CloseWorkbook(Optional ByVal saveChanges As Boolean = False)

Safe to call with nothing managed: that is a harmless no-op.

Parameters:


ReleaseWorkbook #

Release the workbook without saving, ensuring the reference is cleared.

Signature:

Public Sub ReleaseWorkbook()

Never raises: a dead or missing workbook still ends released.


State

HasWorkbook #

Indicates whether a workbook is currently managed.

Signature:

Public Property Get HasWorkbook() As Boolean

Workbook #

Retrieve the managed workbook reference.

Signature:

Public Property Get Workbook() As Excel.Workbook

ErrorHandling

ThrowError #

Centralised error raising aligned with ProjectError codes.

Signature:

Private Sub ThrowError(ByVal errNumber As ProjectError, ByVal errMessage As String)

Used in (9 file(s))