'BEGIN DESCRIPTION ' RUN designated syntax file in BATCH mode. ' This is useful when we want processing to stop on the first error. ' Raynald Levesque 2004/03/02 'END DESCRIPTION Sub Main ' Assign this script to a custom button in your Syntax window toolbar Dim objSyntaxDoc As ISpssSyntaxDoc Dim strDocPath As String Set objSyntaxDoc = objSpssApp.GetDesignatedSyntaxDoc strDocPath = objSyntaxDoc.GetDocumentPath Debug.Print strDocPath objSyntaxDoc.Visible =True If MsgBox ("Save then run this syntax up to first error?", vbYesNo) = vbYes Then objSyntaxDoc.SaveAs strDocPath objSpssApp.ExecuteInclude (strDocPath,False) End If Set objSyntaxDoc = Nothing End Sub