1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
Sub Main
	Dim objDocuments As ISpssDocuments
    Dim objDataDoc As ISpssDataDoc
	Dim strCmd As String
	strCmd = "GET FILE='c:\\Program Files\\SPSS\\Employee data.sav'."
	objSpssApp.ExecuteCommands strCmd , True
		
    Set objDocuments=objSpssApp.Documents
    Set objDataDoc = objDocuments.GetDataDoc(0)

    ' Gets the data within specified range in text form:
    Dim SpssTextData As Variant
    SpssTextData = objDataDoc.GetTextData ("salary", "jobtime", 1, 2)
    MsgBox "Salary of first case is " & SpssTextData(0,0)
    MsgBox "Jobtime of second case is " & SpssTextData(2,1)

End Sub