Open a Model and Modify the Cube Properties Example

This example opens a model and modifies the cube properties.
Sub Example6()
    Dim objTransApp As Object
    Dim objModel As Object
    Dim objCube As Object
    Dim strIBMCognos10Location As String
    Dim strModelPath As String
    Dim strModelSource As String
    'Change these paths to match your installation
    strIBMCognos10Location = "C:\Program Files\IBM\Cognos\c10\"
    strModelSource = "great outdoors sales.mdl"
    strModelPath = strIBMCognos10Location & _
        "webcontent\samples\models\Transformer8\EN\" & strModelSource
    objTransApp = CreateObject("IBMCognosTransformer.ApplicationCtrl.1")
    With objTransApp
        .DataSourcePath = strIBMCognos10Location & "bin"
        .TransdaPath = strIBMCognos10Location & "CS7Gateways\bin\TransDa.exe"
    End With
    objModel = objTransApp.OpenModel(strModelPath)
    objCube = objModel.Cubes.Item(1)
    With objCube
        .BlockParentTotals = True
        .CacheCrossTabs = True
        .CompressMDC = False
        .Consolidate = xtrCubeConsolidate.trConsolidateDefault
        .CubeCreation = xtrCubeCreation.trCubeCreationON
        .DesiredPartitionSize = 500000
        .EstimatedRows = 10000000
        .IncrementalUpdate = False
       .MaxNumPartLevels = 5
        .MDCFile = "GoCube"
        .Optimize = xtrCubeOptimize.trOptimizeAutoPartition
        .Name = "Great Outdoors Sales (Optimized)"
        .Update()
        .CreateMDCFile()
    End With
    objModel.SaveAs("great outdoors salesX.mdl")
    objModel.Close()
    objCube = Nothing
    objModel = Nothing
    objTransApp = Nothing
End Sub