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
|
Sub ImporterFichierXML()
Dim XM As XmlMap
'Importe le fichier dans la cellule B1 de la Feuil3.
ThisWorkbook.XmlImport _
URL:="C:\Documents and Settings\Desktop\TTT_20130624_001.xml",_
ImportMap:=Nothing, _
Overwrite:=True, _
Destination:=Worksheets("A1").Range("$B$1")
'.Range("$B$1")
'Définit le mappage qui vient d'être ajouté.
'ThisWorkbook.XmlMaps.Count correspond au dernier xml mappé dans le classeur
Set XM = ThisWorkbook.XmlMaps(ThisWorkbook.XmlMaps.Count)
MsgBox "Import terminé" & vbCrLf & _
XM.RootElementName & vbCrLf & _
XM.Name & vbCrLf & _
XM.DataBinding.SourceUrl
End Sub |
Partager