Customizing output in a recorded macro
A recorded analysis macro will route all its output to whatever your current output mode is by calling the RouteOutput function. For example, if your output mode is set to workbook, then a macro's output will go into a new workbook. To override this behavior, look for RouteOutput in your macro and change it to directly access the generated documents. Consider the following code generated from a Descriptive Statistics analysis:
Option Base 1 Sub Main Dim newanalysis As Analysis Set newanalysis = Analysis (scBasicStatistics, ActiveDataSet) 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 = True .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 End Sub
Prerequisites
Procedure
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.