I'm unable to find a way in VBA to identify calculated columns in the data model. I can enumerate the columns
But the .DataType property returns 130 for all columns, nor can I see another property to give the formula in the column.
Code:
Dim objMTables As ModelTables
Dim objMCols As ModelTableColumns
Dim objMCol As ModelTableColumn
Set objMTables = ActiveWorkbook.Model.ModelTables
For Each objMTable In objMTables
Debug.Print "** " & objMTable.name
For Each objMCol In objMTable.ModelTableColumns
Debug.Print objMCol.name & " - " & objMCol.DataType
Next objMCol
Next objMTable
But the .DataType property returns 130 for all columns, nor can I see another property to give the formula in the column.