Report.GetObject

Returns a handle to the specified object in the report.

Syntax Parameters Return/assignment value
Function Report.GetObject( _
    index As Integer) As Variant
index [in]

The index of which object in the report to return.

Type: Integer

Variant

Remarks: If you know which document type an embedded object is in a report, then set a temporary document variable to that object to edit it. Use the report's function GetObject to retrieve any embedded object.

SVB Example

Editing an item in a report:

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.OutputOption.ReportPlacement = scAnalysisReport
    newanalysis.OutputOption.SupplementaryInfoLevel = scInfoLevelNone

    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

    Dim rpt As Report
    newanalysis.RouteOutput(newanalysis.Dialog.Summary).Visible = True
    Set rpt = newanalysis.RouteOutput(newanalysis.Dialog.Histograms).Report

    'get the spreadsheet in the report and sort the Maximum column (high to low).
    'Because we know that the first embedded object in the report is a spreadsheet,
    'we set a spreadsheet variable it by calling GetObject and telling it object 1.
    Dim spr As Spreadsheet
    Set spr = rpt.GetObject(1)
    spr.SortDataEx("4",Array(scSortDescending),Array(scSortByNumeric),False,True)

End Sub