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

Report Bursting Macro Change from PDF to Excel or Text

Status
Not open for further replies.

MSIsam

Programmer
Sep 29, 2003
173
US
I have a macro that is used to burst a report into multiple PDF's and would like to know how to convert it to Excel, csv, or Text. Running BI 5.1.3.
Code:
Sub DIV_XLS()
    Dim mydoc As Document
    Dim myrpt As Report
    Dim myFilterVar As DocumentVariable
    Dim intNumChoices As Integer
    Dim i As Integer
    Dim myFilterChoices As Variant
    Dim strNextValue As String
    
    Application.Interactive = False
    Application.BreakOnVBAError = False
    Set mydoc = Application.Documents(1)
    Set myrpt = mydoc.Reports.Item(1)
    Set myFilterVar = mydoc.DocumentVariables("vDivision")
    
    intNumChoices = UBound(myFilterVar.Values(boUniqueValues))
    myFilterChoices = myFilterVar.Values(boUniqueValues)
    For i = 1 To intNumChoices
        strNextValue = myFilterChoices(i)
        myrpt.AddComplexFilter myFilterVar, "=<vDivision>=" & """" & strNextValue & """"
        myrpt.ForceCompute       
 [COLOR=red]       mydoc.ExportAsPDF ("C:\BURST_TEST\DIV_" & strNextValue & ".pdf")     [/color]
    Next i
End Sub
I have tried the obvious and changed mydoc.ExportAsPDF to mydoc.ExportAsTxt, mydoc.ExportAsXLS and mydoc.ExportAscsv along with the proper extensions, but to no avail.
Any help would be greatly appreciated,
Sam
 
BO 5.1.x doesn't do Excel. You have to export as text and then import the text file to Excel. I'd send you a sample, but the folks here won't let me post my email address.

I think you can find one at busobj.forumtopics.com. If not send me a message from there and I'll get you one.

Steve Krandel
VERITAS Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top