Skip to Content
0
Former Member
Dec 03, 2009 at 03:17 PM

Variable not set (error 91)/Error during import (error 102)/execut bat file

68 Views

We are on BO 11.5.0.0 and using the COM SDK with Visual Basic to run multiple reports (sometimes multiple flavors of the same report) through a bat file.

If we run the reports single-threaded through the bat file, the reports run fine. However, if multiple versions of the bat file start at approximately the same time, we get one of two errors:

91 Object variable or With block variable not set

102 Error during import document -

Here's the part of the code with the problem:

Dim BOapp As busobj.Application
Dim receiveDoc As busobj.Document
Set BOapp = New busobj.Application
BOapp.Interactive = False
BOapp.Logon strUser, strPass, strFromSystem, "Enterprise", False, False
BOapp.Visible = False
Set receiveDoc = BOapp.Documents.OpenFromEnterprise(strFromRep, strFromFolder, boFolder)
receiveDoc.SaveAs (strDocumentPath & strFromRep & ".REP")

Values for the following variables are passed in from the bat file:

strUser

strPass

strFromSystem

strFromRep

strFromFolder

strDocumentPath

If it fails on the OpenFromEnterprise statement, we get the 102 error.

If it fails on the SaveAs statement, we get the 91 error.

Running it through debug hasn't helped, since we are running only one report.

Any thoughts on what could be going wrong?

Thanks in advance