Dear all,
Please help...I'm a bit stuck
I have the following code to go through a list and create an XML file with each coresponding item in the list as the file name.
At the moment I am getting an error
Please can someone tell me where I am going wrong.
The txtPath is a field within the form that contains the path of where I want these documents saved.
Thank you so much for your help!!
Kind regards
Triacona
Please help...I'm a bit stuck
I have the following code to go through a list and create an XML file with each coresponding item in the list as the file name.
Code:
Private Sub CreateAllDummyXmls_Click()
On Error GoTo Err_CreateAllDummyXmls_Click
Dim ExcelDoc As String
Dim oApp As Object
Dim sFullPath As String
Dim i As Integer
Set oApp = CreateObject("Excel.Application")
For i = 0 To ListFileName.ListCount - 1
sFullPath = txtPath & ListFileName.ItemData(i) & ".xml"
MsgBox sFullPath
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel3, ListFileName.ItemData(i), sFullPath, True
Next
Exit_CreateAllDummyXmls_Click:
Exit Sub
Err_CreateAllDummyXmls_Click:
MsgBox Err.Description
Resume Exit_CreateAllDummyXmls_Click
End Sub
At the moment I am getting an error
Object Required
Please can someone tell me where I am going wrong.
The txtPath is a field within the form that contains the path of where I want these documents saved.
Thank you so much for your help!!
Kind regards
Triacona