K
kw_uh97
Hello Everyone
I was searching on the discussion board for code that would cycle through a
databases objects (Reports in particular) and have these reports exported as
XML files. I found some code that I thought would accomplish my task. I then
modified if to cycle through reports but I keep getting the error when I
attempt to run it. "The expression that you entered refers to an object that
is closed or does not exist."
Here is my code:
Public Sub ExportToXML()
Dim aob As AccessObject
Dim rpt As Report
Dim sRpt As String, sXML As String, sXSL As String
For Each aob In CurrentProject.AllReports
sRpt = "Reports(aob.Name)"
sXML = "C:\tmp\" & aob.Name & ".xml"
sXSL = "C:\tmp\" & aob.Name & ".xsl"
iFrmt = 0 'ASP format (use 0 for HTML output)
ExportXML acExportReport, sRpt, sXML, , sXSL, , , iFrmt
Next aob
End Sub
Please review and provide guidance if you can. Thanks In Advance for you help.
kw_uh97
I was searching on the discussion board for code that would cycle through a
databases objects (Reports in particular) and have these reports exported as
XML files. I found some code that I thought would accomplish my task. I then
modified if to cycle through reports but I keep getting the error when I
attempt to run it. "The expression that you entered refers to an object that
is closed or does not exist."
Here is my code:
Public Sub ExportToXML()
Dim aob As AccessObject
Dim rpt As Report
Dim sRpt As String, sXML As String, sXSL As String
For Each aob In CurrentProject.AllReports
sRpt = "Reports(aob.Name)"
sXML = "C:\tmp\" & aob.Name & ".xml"
sXSL = "C:\tmp\" & aob.Name & ".xsl"
iFrmt = 0 'ASP format (use 0 for HTML output)
ExportXML acExportReport, sRpt, sXML, , sXSL, , , iFrmt
Next aob
End Sub
Please review and provide guidance if you can. Thanks In Advance for you help.
kw_uh97