WorkbookItem.Object

Use this property to get the dispatch interface of the workbook item. This property is read only.

Syntax Parameters Return value
- - Object

Remarks

Retrieving documents from a workbook is similar to retrieving documents from a report in that each node is returned as an object. From this, we can set a document variable to any given node and have full access to its properties. The only requirement is that we need to know the node's index and which document type it is.

SVB Example

Editing documents in a workbook

Option Explicit
Option Base 1
Sub Main

    Dim newanalysis As Analysis
    Set newanalysis = Analysis (scBasicStatistics, Application.Open(Application.Path & "\Examples\Datasets\Cat Clinic.sta"))

    With newanalysis.Dialog
        .Statistics = scBasDescriptives
    End With

    newanalysis.Run

    With newanalysis.Dialog
        .Variables = "3 6 9"
        .PairwiseDeletionOfMD = True
        .DisplayLongVariableNames = False
        .ExtendedPrecisionCalculations = False
        .PlotMedianQuartileRange = False
        .PlotMeanSEAndSD = False
        .PlotMeanSD196TimesSD = True
        .PlotMeanSE196TimesSE = False
        .UserDefinedPercentiles = False
        .ValidN = True
        .Mean = True
        .Median = False
        .Mode = False
        .GeometricMean = False
        .HarmonicMean = False
        .ConfLimitsForMeans = False
        .Sum = False
        .StandardDeviation = True
        .Variance = False
        .StandardErrorOfMean = False
        .MinimumMaximum = True
        .LowerUpperQuartiles = False
        .Range = False
        .QuartileRange = False
        .Skewness = False
        .Kurtosis = False
        .StandardErrorOfSkewness = False
        .StandardErrorOfKurtosis = False
        .UseNumberOfIntervals = True
        .NumberOfIntervals = 10
        .NormalExpectedFrequencies = False
        .KSAndLillieforsTestForNormality = True
        .ShapiroWilkWTest = False
        .ConfidenceIntervalForMeansPlot = 95
        .CompressedStemAndLeaf = False
    End With

    newanalysis.RouteOutput(newanalysis.Dialog.Summary).Visible = True

    newanalysis.RouteOutput(newanalysis.Dialog.Histograms).Visible = True

    newanalysis.Dialog.ResultsVariables = "6 | 9"
    newanalysis.RouteOutput(newanalysis.Dialog.Scatterplot2D).Visible = True

    Dim wkItem As WorkbookItem
    Dim gr As Graph
    Dim graphLayout As Layout2D

    'Start at the top folder and move to the first histogram
    Set wkItem = ActiveWorkbook.Root
    Dim i As Long
    For i = 1 To 3
        Set wkItem = ActiveWorkbook.NextItem(wkItem)
    Next i

    'Iterate through all three histograms and change their bar colors
    For i = 1 To 3
        Set wkItem = ActiveWorkbook.NextItem(wkItem)
        Set gr = wkItem.Object
        Set graphLayout = gr.Content
        graphLayout.Plots(1).Attribute.Bar.Area.ForegroundColor.Color = RGB(0,200,200)
    Next i

End Sub