Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error refreshing report through BCA

Status
Not open for further replies.

sawebs2

Technical User
May 10, 2005
3
0
0
NL
I am using the following code to refresh a BO report:

Sub RefreshReport()
Dim var As DocAgentOption
Dim DocName As String
DocName = "W:\BusinessObjects\UserDocs\New KPI Files\Apac2005.rep"
Application.Documents.Open (DocName)
Set var = ActiveDocument.DocAgentOption
var.ResetToDefault
var.Server = "BCA"
var.StartDate = Now()
var.EndDate = var.StartDate + 1
var.Users(1) = "GBSWE2"
var.CategoryList = "BCA Reporting;BPS-STBC;CAPEX;FASTER;OPEX;OPSM"
var.ScheduleMode = boOnce
var.Overwrite = True
var.Application.ExchangeMode = boDocAgentMode
var.CustomScript = "Apac2005.rep!RefreshMacro"
var.Send
ActiveDocument.Close
End Sub

I put the following code in the report Apac2005.rep:

Sub RefreshMacro()
ThisDocument.Refresh
End Sub

I get the message "(0) Error during execution of 5.0 macro" and the report is trying to run twice, I presume because I have used both a Refresh command in the report and the Send command in the first macro. Which should I use?

By the way, I do not have "Refresh" in my 5.0 reference library on this server. I have 5.1 on my PC, which does have "Refresh".

Can anybody help please?

Thanks.
 
I'm no VB programmer, but I would be that the reference to W: is an issue. The BCA runs as a service. Services generally don't have access to mapped drives. Generally, people use UNC format to refer to non-local drives.

Steve Krandel
VERITAS Software
 
Thanks Steve. The W: reference does not appear to be a problem as I can see in the VBA window that the report is opening successfully.
It seems to be something that the BCA does not like about using the custom script. I've tried it without the custom script but this does not work either.
Simon.
 
True, you can see it in the VBA window, but.....

The BCA does not refresh the report in your session. It uses a background session owned by the BOMGR process and the WebIntelligence Service. There 2 things don't know what W: is.

We see something very similar when you try to save a report out to a drive. You get an error because the mapped drive does not exist.

Steve Krandel
VERITAS Software
 
yup - always use full UNC when using BCA. Almost certainly BCA views the path as different to that which you are passing to it. Eg, our shared W: drive is actually viewed as BCA's J: drive where I am...

Rgds, Geoff

"Errors have been made....Others will be blamed"

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top