Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Error 2467 on exporting multiple tables to xml file

$
0
0
Hello to all.
I'm receiving the following error message:
"2467: The expression you entered refers to an object that is closed or doesn't exit"

This is the code i'm using:
Code:

Sub ExportDetails()
    Dim objOtherTbls As AdditionalData
    On Error GoTo ErrorHandle
    Set objOtherTbls = Application.CreateAdditionalData
    objOtherTbls.Add "BillingAddress"
    objOtherTbls.Add "Customer"
    objOtherTbls.Add "DocumentTotals"
    objOtherTbls.Add "Header"
    objOtherTbls.Add "Invoice"
    objOtherTbls.Add "Line"
    objOtherTbls.Add "OrderReferences"
    objOtherTbls.Add "Product"
    objOtherTbls.Add "SalesInvoices"
    objOtherTbls.Add "Settlement"
    objOtherTbls.Add "Tax"
    objOtherTbls.Add "TaxTableEntry"
   
    Application.ExportXML ObjectType:=acExportTable, _
    DataSource:="UF", DataTarget:="C:\Lixo\xpto.xml", _
    AdditionalData:=objOtherTbls
   
Exit_Here:
    Exit Sub
ErrorHandle:
    MsgBox Err.Number & ": " & Err.Description
    Resume Exit_Here
End Sub

I am a bit new to this.
Can someone please explain what am i doing wrong?
Thanks a lot for any help.
Octavio

Viewing all articles
Browse latest Browse all 13329

Trending Articles