Utiliser une transformation XSL en vba
Hello à tous,
Je cherche à automatiser l’intégration de fichiers XML via vba, mais j'aimerais cependant pouvoir y appliquer la transformation XSL comme ça l'est possible manuellement.
Le code suivant fonctionne très bien et permet d'importer plusieurs XML dans une même table.
Mais où et comment appeler mon modèle XSL en vba ? :weird:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
Public Sub Export()
Dim strFile As String 'Nom De Fichier
Dim strFileList() As String 'Liste Fichier
Dim intFile As Integer 'Numero de Fichier
Dim filename As String
Dim path As String
DoCmd.SetWarnings False
path = "Y:\Base article\Hicham\ZIS\XML\"
'Boucle dans le dossier ; construction du listing de fichier
strFile = Dir(path & "*.xml")
While strFile <> ""
'Ajout des fichiers dans la liste
intFile = intFile + 1
ReDim Preserve strFileList(1 To intFile)
strFileList(intFile) = strFile
strFile = Dir()
Wend
'Check si aucun fichier n'est trouvé
If intFile = 0 Then
MsgBox "No files found"
Exit Sub
End If
'Boucle parmi tous les ficheirs
For intFile = 1 To UBound(strFileList)
filename = path & strFileList(intFile)
Application.ImportXml filename, acAppendData
Next intFile
DoCmd.SetWarnings True
End Sub |
Merci à vous :D