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.
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.