Option Explicit Sub Main ' This script generates an empty data file with n cases' ' (where n is supplied by the user) ' Posted to SPSS newsgroupd on 2004/04/10 by Raynald Levesque Dim strCmd As String Dim vNbCases As Variant Dim lngNumCases As Long Do vNbCases =InputBox("Create empty data file with how cases?", "Input # of cases","100") If vNbCases = "" Then Exit Sub Loop Until IsNumeric(vNbCases) strCmd = strCmd & "NEW FILE." & vbCrLf strCmd = strCmd & "INPUT PROGRAM." & vbCrLf strCmd = strCmd & "LOOP id=1 TO " & vNbCases & "." & vbCrLf strCmd = strCmd & "END CASE." & vbCrLf strCmd = strCmd & "END LOOP." & vbCrLf strCmd = strCmd & "END FILE." & vbCrLf strCmd = strCmd & "END INPUT PROGAM." & vbCrLf strCmd = strCmd & "FORMATS id (F8)." & vbCrLf strCmd = strCmd & "EXECUTE." & vbCrLf objSpssApp.ExecuteCommands (strCmd,False) End Sub