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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bulk send reports to Broadcast Agent using VBA

Status
Not open for further replies.

thefear

Technical User
Mar 24, 2004
20
Hello folks,

I've got a ton of BO reports to schedule in Broadcast Agent (I'm using BO 5.1.4), and I'd like to so by using a bit of VBA. Below is what I have so far, put together from various sources.

It fails on the .ExportAsText line. I know this isn't the correct method to use, and I've tried .SaveAs and .SaveAsText, but they're all just stabs in the dark. Can anyone enlighten me?


Function Submit()
Dim BoApp As busobj.Application
Dim BODoc As busobj.Document
Dim BORep As busobj.Report
Dim DAOpt As DocAgentOption
Dim stNewFileName As String

Set BoApp = CreateObject("BusinessObjects.application")

With BoApp
'log in to BOBJ
'UserName = InputBox("BO Username: ", "Enter Username")
'Password = InputBox("BO Password: ", "Enter Password")
'.LoginAs UserName, Password
.Visible = True
End With

strDocPath = "c:\test3\"
strCurrentFile = Dir(strDocPath & "*.rep")

Do While strCurrentFile <> ""

Set BODoc = BoApp.Documents.Open(strDocPath & strCurrentFile)
'set the BCA options and send to BCA

Set DAOpt = BODoc.DocAgentOption

With DAOpt
.Server = "Scheduler" 'your BCA Scheduler name
.Refresh = True 'refresh the report
.ScheduleMode = boMonthly 'run only once
.StartDate = Date 'start now
.EndDate = DAOpt.StartDate + 365 'must be later than start
.Send
.ExportAsText ("c:\test3\" & Left(strCurrentFile, Len(strCurrentFile) - 3) & "txt")
.Send
End With

BODoc.Close
strCurrentFile = Dir

Loop

End Function


Thanks for looking!
 


Hi,

What REFERENCE did you set in the VB Editor > Tools > References?

I am trying to locate the correct library.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hi Skip,

DocAgentOption lives in the BusinessObjects 5.1 Object Library.

My machine's unique in the organisation, because it's got BO installed locally. Most people connect over Citrix - I've checked and they don't have the reference available.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top