0
請檢查以下代碼...此處我不想將轉換後的xml代碼保存在任何驅動器中,而是要將內容將轉換後的文件轉換爲現有excel的下一張。在Excel-VBA中。如何在現有工作表中保存xml文件而不保存任何驅動器
Sub GenerateXML()
'
' GenerateXML Macro
'
'
Sheets("Sheet2").Select
ActiveWorkbook.XmlMaps("result_Map").Export URL:="D:\temp3.xml"
Sheets.Add After:=Sheets(Sheets.Count)
With ActiveSheet.QueryTables.Add(Connection:="TEXT;D:\temp3.xml", Destination:=Range("$A$1"))
.Name = "temp3"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(2, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
' Kill "C:\temp.xml"
End Sub
其中是從哪個XML數據生成的? – 2013-05-10 08:31:33