BusinessObjects Board

BCA Error Code = 0x800706be

I am running a macro using BCA and I got this:

Error Code = 0x800706be, Error Message = 'The remote procedure call failed. ',WCode = 0x00000000, Description = ‘[null)’

I check with our BO adminitrator with no result.

Any idea, what is it?

Thanks in advance,


tyltyl (BOB member since 2003-03-28)

I believe, you are running out-of-box application from vba
This error with occur, when you trying to execute one command
but the required objects not available in the virtual memory yet.

post your code snippet and describe what are trying to do, some expert or me could solve your problem.


Shahubar Sadiq :india: (BOB member since 2003-02-28)

Thanks, here are the codes:

Option Explicit

Sub RefreshData()

'MsgBox “refresh data”
'On Error Resume Next
On Error GoTo ErrMsg
Open “\Capsbi.ocgov.com\pdf\test\BOError.log” For Output As #1

Dim Doc As Document
Set Doc = ActiveDocument

Dim Dir As String
'Save at local folder
'Dir = “C:\FTS_LaunchPad”
'save at Server using BCA
'Dir = “\Capsbi.ocgov.com\pdf” 'for release
Dir = “\Capsbi.ocgov.com\pdf\test” 'for testing only

'Define FileName
Dim docName As String
'docName = Doc.Name
Dim ds, ds1, ds2 As String
ds = Date
'MsgBox ds
Dim pos As Integer
pos = InStr(1, ds, “/”, 1)
'MsgBox pos
If pos > 0 Then
ds1 = Left(ds, pos - 1) & “-” & Right(ds, Len(ds) - pos)
Else
ds1 = ds
End If
'MsgBox ds1
pos = InStr(1, ds1, “/”, 1)
If pos > 0 Then
ds2 = Left(ds1, pos - 1) & “-” & Right(ds1, Len(ds1) - pos)
Else
ds2 = ds1
End If
'docName = “RevExpFBCashReport_” & ds2
docName = “FretQtrReport_” & ds2
’ MsgBox FileName

Dim FileName As String
'FileName = Dir & docName

Dim CheckPDFSize As Integer

'define Refresh
Dim FundCode() As String
Dim AgencyCode() As String
Dim NumDocs, startDocNo As Integer
Dim I As Integer

'Input data
’ # of documents to be produce – Need to be modifies

NumDocs = 7
'******************************************************
ReDim FundCode(NumDocs)
ReDim AgencyCode(NumDocs)

'starting document number – Need to be modified…

startDocNo = 4 'The last published report number
'**************************************************
'Need to modify the following array for given fund code
'and agency code

'CEO Funds
FundCode(1) = “289”
AgencyCode(1) = “289”
FundCode(2) = “291”
AgencyCode(2) = “291”
FundCode(3) = “292”
AgencyCode(3) = “292”
FundCode(4) = “293”
AgencyCode(4) = “293”
FundCode(5) = “294”
AgencyCode(5) = “294”
FundCode(6) = “295”
AgencyCode(6) = “295”
FundCode(7) = “298”
AgencyCode(7) = “298”
'FundCode(8) = “100”
'AgencyCode(8) = “003”
'FundCode(9) = “100”
'AgencyCode(9) = “060”
'FundCode(10) = “100”
'AgencyCode(10) = “074”
'FundCode(11) = “100”
'AgencyCode(11) = “080”
'FundCode(12) = “100”
'AgencyCode(12) = “047”
'FundCode(1) = “108”
'AgencyCode(1) = “108”
'FundCode(2) = “113”
'AgencyCode(2) = “113”

'Keep promts and othe boxes from shown up
busobj.Application.Interactive = False
ThisDocument.Application.BreakOnVBAError = False

For I = 1 To NumDocs
FileName = “”
FileName = Dir & docName
Doc.Variables.Item(1).Value = AgencyCode(I)
Doc.Variables.Item(2).Value = AgencyCode(I)
Doc.Variables.Item(3).Value = FundCode(I)
Doc.Variables.Item(4).Value = FundCode(I)
startDocNo = startDocNo + 1
'set up report number label
If (startDocNo < 10) Then
Doc.DocumentVariables.Item(“ReportNumber”).Formula = “00000” & startDocNo
ElseIf (startDocNo < 100) Then
Doc.DocumentVariables.Item(“ReportNumber”).Formula = “0000” & startDocNo
ElseIf (startDocNo < 1000) Then
Doc.DocumentVariables.Item(“ReportNumber”).Formula = “000” & startDocNo
ElseIf (startDocNo < 10000) Then
Doc.DocumentVariables.Item(“ReportNumber”).Formula = “00” & startDocNo
ElseIf (startDocNo < 100000) Then
Doc.DocumentVariables.Item(“ReportNumber”).Formula = “0” & startDocNo
Else
Doc.DocumentVariables.Item(“ReportNumber”).Formula = startDocNo
End If

Doc.Refresh
Doc.Save 'to update the date &amp; time, 12/8/03
' Build file name
'
If StrComp(FundCode(I), AgencyCode(I), 1) = 0 Then
    FileName = Trim(FileName) &amp; "(" &amp; Trim(FundCode(I)) &amp; ")"
Else
    FileName = Trim(FileName) &amp; "(" &amp; Trim(FundCode(I)) &amp; "-" &amp; Trim(AgencyCode(I)) &amp; ")"
End If

Doc.ExportAsPDF (FileName)
'Check for files size, debugging only
'CheckPDFSize = FileLen(FileName)

'If CheckPDFSize > 0 Then
   ' MsgBox "ActiveDocument = " &amp; FileName
'Else
'    MsgBox "File Export Error - " &amp; FileName
'End If

Next I

’ Reset the modes
Exit_Export_As_PDF:
busobj.Application.Interactive = True
ThisDocument.Application.BreakOnVBAError = True
'Set busobj = Nothing

Exit Sub

ErrMsg:
'Open “\Capsbi.ocgov.com\pdf\test\BOError.log” For Output As #1
Print #1, "Error: " & Err.Number & “-” & Err.Description
Close #1
’ reset the error and allows procedure to exit cleanly
Resume Exit_Export_As_PDF
End Sub

Note that if I ran it on an individual workstation, it’s OK. Only if I schedule it to run it using BCA, there are problems, such as that:

After few reports being generated the job got into loop for hours after failure…

Also, the error log file is empty.

The document itself consists a lot of calculations and is presented with 15 charts and their data tables. The data are drawn from 17 data providers. The document consists of 21 reports. I have timed it on my machine quite a few times for one single refresh. Normally it takes about 3-4 minutes for refresh and another 7-10 minutes for saving it as a PDF file.

Another problem I have been experiencing is the location of hyperlinks on the reports. After the document is converted into PDF format, the true hyperlink location will be either on the top of the url or below it. I need to move the url and footer ups and downs to make them on top of each other, a trial and error process that is VERY time-consuming. The true hyperlink positions are located randomly and can be anywhere on the report in PDF. I filed this problem to BO Technical Support Group last November, but no response whatsoever.

Again, thanks for all help and attention.


tyltyl (BOB member since 2003-03-28)

P.S. Once the BCA task fails with error and gets into loop, I don’t know how to kill/delete the process. If I click on “interupt” as ONLY shown on right-click pop-up menu. The BCA Console will freeze. I need to restart my system to get it back to normal.

Thanks again,


tyltyl (BOB member since 2003-03-28)

i’m sorry, i didn’t find any problem into your code, looks fine
my question is: In where/which event, you are calling this subroutine


Shahubar Sadiq :india: (BOB member since 2003-02-28)

Many thanks for checking it, Shahubar.

I use it as a macro. When I run it on my own machine, there is not problem to generate the reports of any desired number despite it may take a while. But, when I “Send to”-> “BCA” -> Action -> use it a “Custom Macro” -> schedule the time to run it. I will encounter the problem.

Some additional info I would like to share with. After the posting I have added the following codes in the macro to track the processing time for “refresh” and “SaveAsPDF”:

'Dim StartTime, EndTime As String

StartTime = Time
Print #1, "Before Refresh: " &amp; StartTime
  
Doc.Refresh
Doc.Save 'to update the date &amp; time, 12/8/03

EndTime = Time
Print #1, "After Refresh: " &amp; EndTime
' Build file name
'
If StrComp(FundCode(I), AgencyCode(I), 1) = 0 Then
    FileName = Trim(FileName) &amp; "(" &amp; Trim(FundCode(I)) &amp; ")"
Else
    FileName = Trim(FileName) &amp; "(" &amp; Trim(FundCode(I)) &amp; "-" &amp; Trim(AgencyCode(I)) &amp; ")"
End If

StartTime = Time
Print #1, "Before ExportAsPDF: " &amp; StartTime &amp; "-" &amp; FileName

Doc.ExportAsPDF (FileName)
'Check for files size, debugging only
'CheckPDFSize = FileLen(FileName)

'Sleep 5000

EndTime = Time
Print #1, "After ExportAsPDF: " &amp; EndTime

The result in a nutshell:

I found out that the “refresh” does not take a lot of time, but “ExportAsPDF” consumes most of the time. And I do not know why “ExportAsPDF” would take so much time.


tyltyl (BOB member since 2003-03-28)

ExportAsPDF very slow because BO may be using acrobat api internally with all kind of possiblities/feature :!: . i have no idea

Anyway, it should not break the process.(in BCA also),

verify the BOMANAGER/BCA parameter settings
for ex: increase, timeout for batch action

run the same report into BCA server manually, is that worked?


Shahubar Sadiq :india: (BOB member since 2003-02-28)

Thanks for your kind reply.

Unfortunately we are outsourcing other firm to manage BCA server for us. Therefore, I need to go through ladders to get to the BOManager setting. But, I will check on it.

Last night I let the macro sleep for 5 minutes between “SaveAsPDF” processes and ran it via BCA. THis morning I see the log on BCA Console, it still failed with only two reports generated.

Again, thanks.


tyltyl (BOB member since 2003-03-28)

For performance, make sure heap size was set it up properly(interactive/non-interactive).
search for heap at :mrgreen:


Shahubar Sadiq :india: (BOB member since 2003-02-28)

For anyone coming into this topic from a search engine, this answer in the FAQ may be of use :slight_smile:


RobinM :uk: (BOB member since 2003-02-25)