Class Model (Excel VBA)

Thank you.

Class Workbook gives access to class Model.

Member in collection

Item

To use a Model class variable it first needs to be instantiated, for example

Dim mdl as Model
Set mdl = ActiveWorkbook.Model

Model class variables can be set using the Workbook.Model procedure.

Methods

AddConnection - Adds a new WorkbookConnection to the model with the same properties as the one supplied as an argument.

CreateModelWorkbookConnection - Returns a WorkbookConnection object of type ModelConnection.

Initialize - Initializes the Workbook's data model. This is called by default the first time the model is used.

Refresh - Refreshes all data sources associated with the model, fully reprocesses the model, and updates all Excel data features associated with the model.

Properties

DataModelConnection returns the model WorkbookConnection object from the workbook connections collection that connects to the model.

ModelFormatBoolean returns a ModelFormatBoolean object that represents formatting of type True/False in the data model.

ModelFormatCurrency returns a ModelFormatCurrency object that represents formatting of type currency in the data model.

ModelFormatDate returns a ModelFormatDate object that represents formatting of type date in the data model.

ModelFormatDecimalNumber returns a ModelFormatDecimalNumber object that represents formatting of type decimal number in the data model.

ModelFormatGeneral returns a ModelFormatGeneral object that represents formatting of type general in the data model.

ModelFormatPercentageNumber returns a ModelFormatPercentageNumber object that represents formatting of type percentage number in the data model.

ModelFormatScientificNumber returns a ModelFormatScientificNumber object that represents formatting of type scientific number in the data model.

ModelFormatWholeNumber returns a ModelFormatWholeNumber object that represents formatting of type whole number in the data model.

ModelMeasures returns a ModelMeasures object that represents the collection of model measures in the data model.

ModelRelationships returns a ModelRelationships object that represents the collection of relationships between data model tables.

ModelTables returns a ModelTables object that represents a collection of tables inside the data model.

Name returns a String value representing the name of the Model object.

ModelFormatBoolean - Represents the format to be used for a model measure in the data model.

ModelFormatCurrency - Represents the format to be used for a model measure in the data model.

ModelFormatDate - Represents the format to be used for a model measure in the data model.

ModelFormatDecimalNumber - Represents the format to be used for a model measure in the data model.

ModelFormatGeneral - Represents the format to be used for a model measure in the data model.

ModelFormatPercentageNumber - Represents the format to be used for a model measure in the data model.

ModelFormatScientificNumber - Represents the format to be used for a model measure in the data model.

ModelFormatWholeNumber - Represents the format to be used for a model measure in the data model.

ModelMeasures - Represents a collection of ModelMeasure objects.

ModelRelationships - This collection contains all relationships between data tables in the data model of Excel 2013.

ModelTables - A collection of model tables inside the data model.

WorkbookConnection - A connection is a set of information needed to obtain data from an external data source other than a Microsoft Excel workbook.