I’m trying to save an XML from Excel conversion into newDoc which is a MSXML2.DOMDocument, however whenever I run my code it highlights .SaveAs and says that the method or data member is not found. I understand that this is because newDoc is not a workbook, but how else would I go around this?
xslDoc.async = False doc.transformNodeToObject xslDoc, newDoc Dim Docname As String Dim fileSaveName As Variant Docname = "123_" & SN.Text fileSaveName = Application.GetSaveAsFilename(InitialFileName:=sItem * Docname, filefilter:="XML Files (*.xml),*xml") ' newDoc.SaveAs Filename:=fileSaveName, FileFormat:=xlTextPrinter, CreateBackup:=False
You can use the
save method of the DOMDocument class (note that the
CreateBackup are not arguments for this method).