I got a fix for this code on this thread and now Im getting a Permission 70 even if I save it to my desktop path. Have tried multiple paths and still no luck.
Rows to individual xml files including content value
Sub Export()
sTemplateXML = _
"<data>" + vbNewLine + _
" <Name/>" + vbNewLine + _
" <AXCustNum/>" + vbNewLine + _
" <CustomerName/>" + vbNewLine + _
" <Title/>" + vbNewLine + _
" <Folder/>" + vbNewLine + _
"</data>" + vbNewLine
Set doc = CreateObject("MSXML2.DOMDocument")
doc.async = False
doc.validateOnParse = False
doc.resolveExternals = False
With Sheets("SAL Checked File Names 1.9")
lLastRow = .UsedRange.Rows.Count
For lRow = 2 To lLastRow
sname = .Cells(lRow, 1).Value
saxcustnum = .Cells(lRow, 2).Value
scustomername = .Cells(lRow, 3).Value
sTitle = .Cells(lRow, 4).Value
sFolder = .Cells(lRow, 5).Value
doc.LoadXML sTemplateXML
doc.getElementsByTagName("Name")(0).appendChild doc.createTextNode(sname)
doc.getElementsByTagName("AXCustNum")(0).appendChild doc.createTextNode(saxcustnum)
doc.getElementsByTagName("CustomerName")(0).appendChild doc.createTextNode(scustomername)
doc.getElementsByTagName("Title")(0).appendChild doc.createTextNode(sTitle)
doc.getElementsByTagName("Folder")(0).appendChild doc.createTextNode(sFolder)
doc.Save sFolder
Next
End With
End Sub
I think it is erroring at "doc.Save sFolder"