Error 200 in Method INITREPORTENGINE

SUGGESTED

I'm running a BOI script to export the GL trial balance.  I copied most of this from Kent Mackall's example.

It runs fine on my computer and on the client's server, but errors on all of the workstations including the one that they want to run it on.  Sage100 Standard v5.00.4.0.  Any ideas?

Here's the script:

retVal = 0

'Create ProvideX COM Object
Set oScript = CreateObject ("ProvideX.Script")

'The Init method must be the first method called, and requires the path to the MAS90 home directory
oScript.Init("M:\Sage 2013\MAS90\Home\")

Set oSS = oScript.NewObject("SY_Session")

retVAL = oSS.nSetUser("ALL","")

retVAL = oSS.nSetCompany("ABC")

retVAL = oSS.nSetDate("G/L","20150531")

retVAL = oSS.nSetModule("G/L")

retVAL = oSS.nSetProgram(oSS.nLookupTask("GL_TrialBalance_ui"))

Set oGLReport = oScript.NewObject("GL_TrialBalance_rpt", oSS)

options = "SORTREPORTBY$=""A"";DB_TYPEOFBALANCE$=""E"";DB_FISCALYEAR$="""";DB_STARTPERIOD$="""";DB_ACCOUNTINGPERIOD$="""";DB_ENDPERIOD$="""";CB_ZEROBALANCE$=""Y"";CB_CONDENSEDPRINT$=""N"""

retVAL = oGLReport.nSetOptions(options)

'BEGIN EXPORT SPECIFIC LOGIC

'The following options and methods are the keys to exporting the report.

'nReportType is used to suppress the Export Selection dialogue (UI) that displays when exporting a

'report in Sage 100. This must always be set to 6 in order to suppress the selection dialogue. This must be

'set prior to calling the nProcessReport() method. Do not set this value at all if you want the export selection

'dialogue to display.

oGLReport.nReportType = 6

'nInitReportEngine() is called to create the report object that is required in order to set the export options.

'This must be called before the call to nSetExportOptions()

retval = oGLReport.nInitReportEngine()

'nSetExportOptions(nOuptutFormat, sOuputPath) is called to set the output format and path.

'nOuputFormat is a numeric value and can be one of the following values/export types:

' Ouput Format Values/Types

' 2 Rich Text

' 3 Microsoft Word

' 4 Microsoft Excel

' 5 PDF

' 9 Text

' 10 CSV

' 11 Tab Separated

' 12 Editable Rich Text

' 13 XML

'nOuputPath is the path where the file will be exported/created. This should be the full path and filename

'(i.e. "C:\temp\GL_TrialBalance.pdf"). This was tested using an existing path.

nOuputFormat = 5

sOuputPath = "C:\temp\GL_TrialBalance.pdf"

retval = oGLReport.nSetExportOptions(5, "C:\TEMP\GL_TrialBalance.pdf")

'nProcessReport(sDestination) is called with “EXPORT” as the destination which will export the report in the format and to the location specified in the nSetExportOptions() call above.

retVal = oGLReport.nProcessReport("EXPORT")

'END EXPORT SPECIFIC LOGIC

oSS.nCleanup()

oSS.DropObject()

Set oSS = Nothing

Set oScript = Nothing

msgbox("Done")