Reputation: 99
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
Upvotes: 1
Views: 417
Reputation: 53663
You can use the save
method of the DOMDocument class (note that the FileFormat
and CreateBackup
are not arguments for this method).
Upvotes: 2