我正在尝试将XML从Excel转换保存到MSDoc2.DOMDocument的newDoc中,但是,每当我运行代码时,它都会突出显示.SaveAs并指出未找到该方法或数据成员。我了解这是因为newDoc不是工作簿,但是我还要怎么解决呢?
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