Issue in Macro using XML DOM on Windows 7

Optimus29

New Member
Joined
Oct 21, 2011
Messages
9
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>
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}
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,223,227
Messages
6,170,847
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top