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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
| Sub ImportXMLData(cFile, racine As String)
Application.DisplayAlerts = False
Dim cNumberformat As String
'
On Error Resume Next
Set xCalibryReport = New MSXML2.DOMDocument60
If xCalibryReport Is Nothing Then
MsgBox "This tool requires Microsoft XML 6.0. Please download it from the Microsoft website", vbOKOnly + vbCritical
End
End If
'
'Load the new xml
xCalibryReport.Load cFile
Dim xElementList As MSXML2.IXMLDOMNodeList
Dim xElement As MSXML2.IXMLDOMElement
Set xElementList = xCalibryReport.getElementsByTagName("Weight")
If Not xElementList Is Nothing Then
For Each xElement In xElementList
xElement.Text = Replace(xElement.Text, ",", ".")
Next
End If
Set xElementList = xCalibryReport.getElementsByTagName("Mean")
If Not xElementList Is Nothing Then
For Each xElement In xElementList
xElement.Text = Replace(xElement.Text, ",", ".")
Next
End If
Set xElementList = xCalibryReport.getElementsByTagName("SEul")
If Not xElementList Is Nothing Then
For Each xElement In xElementList
xElement.Text = Replace(xElement.Text, ",", ".")
Next
End If
Set xElementList = xCalibryReport.getElementsByTagName("SE")
If Not xElementList Is Nothing Then
For Each xElement In xElementList
xElement.Text = Replace(xElement.Text, ",", ".")
Next
End If
Set xElementList = xCalibryReport.getElementsByTagName("REul")
If Not xElementList Is Nothing Then
For Each xElement In xElementList
xElement.Text = Replace(xElement.Text, ",", ".")
Next
End If
Set xElementList = xCalibryReport.getElementsByTagName("RE")
If Not xElementList Is Nothing Then
For Each xElement In xElementList
xElement.Text = Replace(xElement.Text, ",", ".")
Next
End If
Set xElementList = xCalibryReport.getElementsByTagName("ZFactor")
If Not xElementList Is Nothing Then
For Each xElement In xElementList
xElement.Text = Replace(xElement.Text, ",", ".")
Next
End If
Set xElementList = xCalibryReport.getElementsByTagName("Evaporation")
If Not xElementList Is Nothing Then
For Each xElement In xElementList
xElement.Text = Replace(xElement.Text, ",", ".")
Next
End If
Set xElementList = xCalibryReport.getElementsByTagName("Sensibility")
If Not xElementList Is Nothing Then
For Each xElement In xElementList
xElement.Text = Replace(xElement.Text, ",", ".")
Next
End If
ActiveWorkbook.XmlMaps("Protocol_Map").ImportXml xCalibryReport.XML
Range("CertificateNo").Value = SequenceNo(racine)
Range("A1").Select
Application.DisplayAlerts = True
End Sub |
Partager