I have a Word macro that opens an XML file, makes some changes, saves and closes the file. The XML file exists but is definitely not open when the code gets to the point below. Just before the file opens I get an error message saying: "Run-time error '-2147024864 (80070020) The process cannot access the file -filename here- because it is being used by another process."
If I end the macro, close the .xml file and restart the macro I don't get the error message the second time. The error message pops up when the macro is at the code below.
Documents.Open FileName:=strInfoXMLName, ConfirmConversions:=False, Format:=wdOpenFormatText