Ajoo
02-04-2010, 12:08 PM
Sub Button1_Click()
MsgBox "Inside"
Dim code As String
Dim name As String
Dim strXML As String
Dim newFileName As String
Dim objNodeList As String
code = Sheet1.Range("B1")
name = Sheet1.Range("B2")
newFileName = code & "_" & "MyTestXML.xml"
Dim objXML As New MSXML2.DOMDocument
objXML.Load ("c:\MyTestXML.xml")
' get the example node
Set objElem = objXML.SelectSingleNode("generalInfo")
'objNodeList = objXML.getElementsByTagName("generalInfo")
MsgBox "Inside"
End Sub
Thanks
MyTestXML
<masterAgreements>
<masterAgreement>
<generalInfo code="UK_ABCD_MA_hrl" currencyCode="GBP" name="ABCD Master Agreement" startDate="01/01/2009" _
supplierCode="0020054719GB00P062" negotiableType="NOT_TO_EXCEED" supplierName="test" orderEndDateApplicable="Y">
<description>Hourly Rates</description>
</generalInfo>
</masterAgreement>
</masterAgreements>
MsgBox "Inside"
Dim code As String
Dim name As String
Dim strXML As String
Dim newFileName As String
Dim objNodeList As String
code = Sheet1.Range("B1")
name = Sheet1.Range("B2")
newFileName = code & "_" & "MyTestXML.xml"
Dim objXML As New MSXML2.DOMDocument
objXML.Load ("c:\MyTestXML.xml")
' get the example node
Set objElem = objXML.SelectSingleNode("generalInfo")
'objNodeList = objXML.getElementsByTagName("generalInfo")
MsgBox "Inside"
End Sub
Thanks
MyTestXML
<masterAgreements>
<masterAgreement>
<generalInfo code="UK_ABCD_MA_hrl" currencyCode="GBP" name="ABCD Master Agreement" startDate="01/01/2009" _
supplierCode="0020054719GB00P062" negotiableType="NOT_TO_EXCEED" supplierName="test" orderEndDateApplicable="Y">
<description>Hourly Rates</description>
</generalInfo>
</masterAgreement>
</masterAgreements>