Class ModelTableColumn (Excel VBA)

The class ModelTableColumn represents a single column inside a ModelTable object. To use a ModelTableColumn class variable it first needs to be instantiated, for example


Dim mtc as ModelTableColumn
Set mtc = ActiveWorkbook.Model.ModelRelationships(1).ForeignKeyColumn

For Each

Here is an example of processing the ModelTableColumn items in a collection.


Dim mtc As ModelTableColumn
For Each mtc In ActiveWorkbook.Model.ModelRelationships.ModelTableColumns
	
Next mtc

DataType

Returns the XlParameterDataType enumeration of the ModelTableColumn.


Dim lngDataType As Long
lngDataType = ActiveWorkbook.Model.ModelRelationships(1).ForeignKeyColumn.DataType

Name

Returns a String value that represents the name of the object.


Dim strName As String
strName = ActiveWorkbook.Model.ModelRelationships(1).ForeignKeyColumn.Name