2. data_file_path is XML file path like "c:\data.xml"
Sub Write_read_XML(object_, data_file_path)
'creating object for "Msxml2.DOMDocument"Set xmlDoc = CreateObject("Msxml2.DOMDocument")
'load xml file on object
xmlDoc.load(data_file_path)
'creating an object which can store all values in tag: like in this case all the values inside object_ tag will be saved in ElemList
Set ElemList = xmlDoc.getElementsByTagName(object_)
'Now loop through all the tags with name object_ in your XML file
for n = 0 to 1
'Now to fetch value you can use:
msgbox ElemList.item(n).text
'Incase you need to save values in XML then you can use the code:
ElemList.item(n).text = "value " & cstr(n)
next
I am getting a "Name redefined" error for my functional library since i used Msxml2.DOMDocument. Do you know how can this be fixed?
ReplyDelete