VBA-Excel: Update XML File

In our earlier post we have seen how to Read Data from XML File using in Microsoft Excel. In this tutorial will teach you about how to update an XML file using Microsoft Excel.

I would recommend that you should this post before you continue –Read Data from XML File

Now there are various way you can update XML file –

  • Update Single ParentNode
  • Update attribute of a Node
  • Add a new node under existing node
  • Add new Attribute to the Node

Read moreVBA-Excel: Update XML File

VBA-Excel: Read Data from XML File

To Read Data from XML File using in Microsoft Excel, you need to follow the steps below:

  • Create the object of “Microsoft XML Parser” ) (Microsoft.XMLDOM is the COM object of Microsoft XML Parser)
  • Load the XML from a specified path.
  • Select the tag from the XML file using SelectNodes or SelectSingleNode.

o   SelectNodes – Selects a list of nodes matches the Xpath pattern.

o   SelectSingleNode – Selects the first XMLNode that matches the pattern.

Read moreVBA-Excel: Read Data from XML File