LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2000)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 6 Jun 2000 12:37:25 -0500
Reply-To:   "Bauer, John" <bauer@SPSS.COM>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   "Bauer, John" <bauer@SPSS.COM>
Subject:   Re: run freq using VB , get error on compile error

Paul,

The menu is expecting "analyze>descriptive statistics>frequencies" as displayed in the menu or as documented in the Help file, and not "analyze>summarize>frequencies".

John Bauer, Ph.D. SPSS Developer Support

---------------------------------------------------------------- visit the SPSS Script eXchange: http://www.spss.com/tech/scptxchg/ <http://www.spss.com/tech/scptxchg/> ----------------------------------------------------------------

-----Original Message----- From: Paul Yeo [mailto:paulyeo@CYBERWAY.COM.SG] Sent: Tuesday, June 06, 2000 11:48 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: run freq using VB , get error on compile error

Sorry for asking second question concerning VB syntex, Simliar problem , i have try to the suggestion from Mr Fabrizio on running freq using VB , but i am not able to solve the problem , can some one help me.

TIA

Paul Yeo

************* following is my syntex in VB ************************************

Option Explicit

Private Sub Form_Load()

Dim objSpssApp As ISpssApp Dim objDataDoc As ISpssDataDoc Dim objSpssOptions As ISpssOptions

'.................................................................. 'Create the SPSS application '.................................................................. Set objSpssApp = CreateObject("SPSS.Application")

'Open a new Data Editor Set objDataDoc = objSpssApp.NewDataDoc

'Display Data Editor objDataDoc.Visible = True

'Get the Options object Set objSpssOptions = objSpssApp.Options

'Set measurement system to points objSpssOptions.MeasurementSystem = 0

'Declare variables Dim objDocuments As ISpssDocuments Dim objOutputDoc As ISpssOutputDoc

'============This Section Is WORKING For open 1 OutPut Document ======== Set objDocuments = objSpssApp.Documents

'Loop through the documents collection and cascade Output Documents Dim intCount As Integer Dim I As Integer Dim intWindowPos As Integer intWindowPos = 40 intCount = objDocuments.OutputDocCount For I = 0 To intCount - 1 intWindowPos = intWindowPos + 60 Set objOutputDoc = objDocuments.GetOutputDoc(I) objOutputDoc.Top = intWindowPos objOutputDoc.Left = intWindowPos objOutputDoc.Visible = True Next

'============Open Data file (1) LOVE.SAV Data File ======== ' Declare a variable and open an SPSS data file: 'Dim objDataDoc As ISpssDataDoc Set objDataDoc = objSpssApp.OpenDataDoc("c:\program files\spss\love.sav")

'============= This section select run Freq ============== 'When run the following syntex , i get compile error , syntex error

'Dim objDocuments As ISpssDocuments 'Dim objDataDoc As ISpssDataDoc Set objDocuments = objSpssApp.Documents Set objDataDoc = objDocuments.GetDataDoc(0) ' Invoke the Frequencies dialog:

Dim strPath As String strPath = "analyze>summarize>frequencies" ObjDataDoc.InvokeDialogAndExecuteSyntax "analyze>summarize>frequencies", SpssWindowParent , True

'Mr Fabrizio told me to replace the below line to above the above but it still not work 'objDataDoc.InvokeDialogAndExecuteSyntax (strPath, SpssWindowParent, True)

End Sub

Paul Yeo TDS Technology (S) P/L www.tdstech.com <http://www.tdstech.com> Tel (65) 3661661 Fax(65) 3621661


Back to: Top of message | Previous page | Main SPSSX-L page