Exporting output in SPSS 16

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Exporting output in SPSS 16

Luca Meyer-3
Hello,

I am dealing with another script that since I was using SPSS 15 allowed me
to export selected output into an HTML file:

Sub Main
 Dim objOutputDoc    As ISpssOutputDoc
 Dim objOutputItems    As ISpssItems
 Dim objOutputItem    As ISpssItem
 Dim objSpssPivot    As PivotTable
 Dim intItemCount   As Integer
 Dim index     As Integer
 Dim index1     As Integer
 Dim strFile     As String
 Dim strPath     As String
 Dim strParameter   As String
 Set objOutputDoc = objSpssApp.GetDesignatedOutputDoc
 objOutputDoc.Visible = True
 Set objOutputItems = objOutputDoc.Items
    intItemCount=objOutputItems.Count
 strParameter=objSpssApp.ScriptParameter(0)
 For index=0 To intItemCount-1
  Set objOutputItem=objOutputItems.GetItem(index)
  Debug.Print objOutputItem.SPSSType
  Select Case objOutputItem.SPSSType
   Case 5
    objOutputItem.Selected = True
   Case 10
    objOutputItem.Selected = True
   Case Else
    objOutputItem.Selected = False
  End Select
 Next
 strPath = "c:\temp\"
 strFile = strPath & strParameter & ".htm"
 On Error GoTo ErrorHand
 Kill strFile
 objOutputDoc.ExportDocument(SpssSelected,strFile,SpssFormatHtml,True)
 Exit Sub
 ErrorHand:
 Select Case Err
  Case 10101
   Resume Next
  Case Else
   Debug.Print Err & " " & Err.Description
   MsgBox "Sorry, an error occured! You will have to try to solve the
problem."
   Exit Sub
 End Select
End Sub

Now, when I run this script from SPSS 16 I get the following error:

Run-time error '-2147220992 (80040200)'
JCAdapter not yet initialized

Can anyone help me to understand why I seem not to be able to run SBS files?
Alternatively, is there an SPSS 16 procedure that will allow me to:

(a) select only tables and graphs (that is I do not care about Title, Notes,
Warnings and so on)
(b) export the selected output into HTML

Thank you,

Luca

Mr. Luca MEYER
Market research, data analysis & more
HYPERLINK "http://www.lucameyer.com/"www.lucameyer.com - Tel:
+39.339.495.00.21




No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.17/1252 - Release Date: 30/01/2008
20.51

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD