So I think I managed to make it work. I tried the code first with xmlswitch but I got an error. I tried it without but I got separate tables for each XML (TABLE, TABLE1, TABLE2, etc...) instead an appended single TABLE.
I used acAppendData instead. I think it worked. Here is my final code:
Code:
Sub XMLImport()
Dim fs
Dim fsFolder
Dim fsFile
Set fs = CreateObject("scripting.filesystemobject")
Set fsFolder = fs.getfolder("D:\XML")
For Each fsFile In fsFolder.files
Debug.Print fsFile.Name
Application.ImportXML "D:\XML\" & fsFile.Name, acAppendData
Next fsFile
End Sub
I will look it over to see if it works but I think it is fine. Thanks again for your help.