Hi Members,
I have designed a Macro which will pull values of given XML Tags from XML files and copies them to excel sheet.
The macro works fine on Windows XP (for both Office 2007 and Office 2010) however revently I tested it on Windows 7 machine and it started giving me following error.
It is not able to load XML file it seems.
Can you please help me with this?
Thanks in Advance
Error code: -2146697211 The system cannot locate the resource specified.
Following is the code</SPAN></SPAN>
I have designed a Macro which will pull values of given XML Tags from XML files and copies them to excel sheet.
The macro works fine on Windows XP (for both Office 2007 and Office 2010) however revently I tested it on Windows 7 machine and it started giving me following error.
It is not able to load XML file it seems.
Can you please help me with this?
Thanks in Advance
Error code: -2146697211 The system cannot locate the resource specified.
Following is the code</SPAN></SPAN>
Code:
Sub XML_Validate()
Dim objXML As MSXML2.DOMDocument
Dim objElement
Dim strField As String
Dim strValue As String
Dim strFile As String
Dim iRow As Integer
Dim iCol As Integer
Dim iCnt As Integer
Dim iBasevaluecol As Integer
Dim iFieldcol As Integer
Dim iFileRow As Integer
Dim iFileCol As Integer
For iCnt = 1 To (iNo_of_Files)
iRow = 2
Set objXML = New MSXML2.DOMDocument
strFile = Worksheets("Instructions").Cells(iFileRow, iFileCol).Value
objXML.Load strFile
If objXML.parseError.ErrorCode <> 0 Then
'MsgBox "Error in accessing XML file" & objXML.parseError.ErrorCode & objXML.parseError.reason
Worksheets("Instructions").Cells(iFileRow, iFileCol + 1).Value = "Error code: " &
objXML.parseError.ErrorCode & " " & objXML.parseError.reason
'Exit Sub
End If
{Some logic for copying the XML Tag values}