Haluk
Özel Üye
- Katılım
- 7 Temmuz 2004
- Mesajlar
- 12,406
- Excel Vers. ve Dili
-
64 Bit 2010 - İngilizce
+
Google Sheets
+
JScript
- Altın Üyelik Bitiş Tarihi
- ∞
C#:
Sub Test()
Dim xDoc As Object
Cells.Clear
Set xDoc = CreateObject("MSXML2.DOMDocument")
xDoc.async = False
xDoc.validateOnParse = False
yol = ThisWorkbook.Path & "\"
dosya = Dir(yol & "*" & ".xml", vbNormal)
If dosya = "False" Then Exit Sub
x = 1
Do
xDoc.Load yol & dosya
Set Malzeme = xDoc.SelectNodes("//Invoice/cac:InvoiceLine/cac:Item/cbc:Name")
Set Tanim = xDoc.SelectNodes("//Invoice/cac:InvoiceLine/cbc:ID")
Set Fatura = xDoc.SelectNodes("//Invoice/cbc:ID")
Set Miktar = xDoc.SelectNodes("//Invoice/cac:InvoiceLine/cbc:InvoicedQuantity")
Set xName = xDoc.SelectSingleNode("//cac:AccountingSupplierParty/cac:Party/cac:PartyName/cbc:Name")
For i = 0 To Malzeme.Length - 1
Cells(x, 1) = Tanim.Item(i).nodetypedvalue
Cells(x, 2) = Fatura.Item(0).nodetypedvalue
Cells(x, 3) = xName.Text
Cells(x, 4) = Malzeme.Item(i).nodetypedvalue
Cells(x, 5) = Miktar(i).Attributes.getNamedItem("unitCode").Text
Cells(x, 6) = Miktar.Item(i).nodetypedvalue
x = x + 1
Next
dosya = Dir()
Loop While dosya <> ""
Cells.EntireColumn.AutoFit
Set xDoc = Nothing
End Sub
Son düzenleme: