Macro (SVB) Programs Example - Retrieving a Collection of Spreadsheets

Ribbon bar. Select the Home tab. In the File group, click New.

Classic menus. From the File menu, select New.

In the Create New Document dialog box, select the Macro tab and create a macro called Example 2.

Ribbon bar. Select the Edit tab. In the Tools group, click References.

Classic menus. From the Tools menu, select References.

In the References dialog box, select the Statistica Basic Statistics Library (1.0) check box, and click OK to close the dialog box.

Then, in the newly created macro, type (or paste) in the following program:

Sub Main 
' Create the Statistica Basic Statistics Analysis object; 
' open the input data spreadsheet (example file) Exp.sta 
' NOTE: This file may reside in a different directory on 
' your installation.
Dim spr As Spreadsheet
Set spr = Spreadsheets.Open _ (Path & "\Examples\DataSets\Exp.sta")		
Set newanalysis = Analysis (scBasicStatistics, spr)		
' Select from the startup dialog of Basic Statistics, option 
' Frequency tables .		
newanalysis.Dialog.Statistics = scBasFrequencies
' "Click OK", i.e., Run this dialog.		
	newanalysis.Run		
' On the following dialog, select variables 1-8.		
newanalysis.Dialog.Variables = "1-8"
' Then make the Summary results spreadsheet.
Set s=newanalysis.Dialog.Summary
' Set all Visible property for all results Spreadsheets to False
s.Visible=False
' Display a message box with the number of Spreadsheets in the ' Collection.
MsgBox "Number of Spreadsheets: " + s.Count
' Make only the last results Spreadsheet in the collection visible.
s.Item(s.Count).Visible=True
End Sub

Manipulating and editing Statistica documents. Spreadsheets and graphs are only two of the document types that Statistica uses to handle input and output of Statistical analyses. Other document types are (text) reports, and workbooks, in which you can organize and manage all other documents. There are a large number of properties and methods available for each of these types of documents that you can use to customize your results or to access aspects of your results for further processing.