Tips for converting xml to xlsx
...
.OpenAfterSaving = .F.
.Save("test.XML")
oExcel = CreateObject("Excel.Application")
if vartype(oExcel) != "O"
* could not instantiate Excel object
* show an error message here
return .F.
EndIf
oExcel.visible = .T.
If File("test.xml")
oWorkbook = oExcel.Application.Workbooks.Open("test.xml")
oWorkbook.saveas("test",51) && xlsx, see below for list of few valid excel recent format
If File("test.xlsx")
Delete File "test.xml"
endif
EndIf
oExcel= .null.
where
51 = xlOpenXMLWorkbook (without macro's in 2007-2013, xlsx)
52 = xlOpenXMLWorkbookMacroEnabled (with or without macro's in 2007-2013, xlsm)
50 = xlExcel12 (Excel Binary Workbook in 2007-2013 with or without macro's, xlsb)
56 = xlExcel8 (97-2003 format in Excel 2007-2013, xls)
↧