0

I have XML files that I need to import and edit. Then I need to be able to export them with all of the same header tags. Essentially not changing anything but the values in the XMLs. When I use application.importXML it is easy to change the values, however when I then use ExportXML it changes and replaces the header tags with it's own default. The only way I found to get around this is to import the XMLs as a text file then edit, but then it isn't formatting properly.

Is there a way to import/export XML in Access virtually unchanged besides a few of the values? I need the solution to use Access VBA.

Josh
  • 95
  • 1
  • 5

1 Answers1

1

If you want to edit the values within an XML file with VBA, I suggest using the XMLDOM object. You can access single nodes and edit them without changing the structure or tag values.

This example will give you a good start, here is the official documentation (applies to VBA).

This SO article also provides good sources on the topic.

  • 1
    I was able to figure it out. The external program reading the XMLs was having an issue with the header comments, so it worked once I was able to figure out how to export the header comments exactly as they were in the original files. Thanks – Josh Jul 27 '17 at 20:52