Sub
readXML()
Dim
vntFiles
As
Variant
, vntValues()
As
Variant
Dim
lngIndex
As
Long
, lngC
As
Long
Dim
ff
As
Integer
Dim
strTmp
As
String
vntFiles = Application.GetOpenFilename(
"XML Dateien (*.xml),*.xml"
, MultiSelect:=
True
)
If
IsArray(vntFiles)
Then
ReDim
vntValues(1
To
UBound(vntFiles) + 1, 1
To
6000)
vntValues(1, 1) =
"File"
For
lngIndex = LBound(vntFiles)
To
UBound(vntFiles)
vntValues(lngIndex + 1, 1) = Mid(vntFiles(lngIndex), InStrRev(vntFiles(lngIndex), "\") + 1)
ff = FreeFile
lngC = 1
Open vntFiles(lngIndex)
For
Input
As
#ff
Do
While
Not
EOF(ff)
Line Input #ff, strTmp
strTmp = Trim$(strTmp)
If
LCase(strTmp)
Like
"<additionalcode bookingsequence=*"
Then
lngC = lngC + 1
strTmp = Mid(strTmp, 34)
strTmp = Left(strTmp, Len(strTmp) - 19)
If
InStr(1, strTmp,
">"
)
Then
If
lngIndex = 1
Then
vntValues(lngIndex, lngC) = Split(strTmp,
""
""
)(0)
vntValues(lngIndex + 1, lngC) = Replace(Split(strTmp,
""
">"
)(1),
","
,
"."
)
End
If
End
If
Loop
Close #ff
Next
End
If
With
Range(
"A1"
).Resize(UBound(vntValues, 1), UBound(vntValues, 2))
.Value = vntValues
.NumberFormat =
"0.00"
.Columns.AutoFit
End
With
End
Sub