以下是引用schtg在2022-3-27 07:22:06的发言:
我在ID大师那学习到了一点点儿,仅供参考哈
LoadLIBXL()
Book = xlCreateBookCA()
sheet = xlBookAddSheetA(Book, [stu] ,0)
* 写
xlSheetWriteStrA(sheet,1,1,[姓名],0)
xlSheetWriteStrA(sheet,1,2,[年龄],0)
xlSheetWriteStrA(sheet,2,1,[张三],0)
xlSheetWriteStrA(sheet,3,1,[李四],0)
xlSheetWriteNumA(sheet,2,2,22,0)
xlSheetWriteNumA(sheet,3,2,23,0)
* 读
? xlSheetReadStrA(sheet, 1 , 1 , 0)
? xlSheetReadNumA(sheet, 2 , 2 , 0)
* 存
xlBookSaveA(BOOK,[测试.xls])
* 放
xlBookReleaseA(BOOK)
***
***
PROC LoadLIBXL
DECLARE LONG xlCreateBookCA in libxl.dll
DECLARE LONG xlCreateXMLBookCA in libxl.dll
DECLARE INTEGER xlBookLoadA in libxl.dll LONG handle , STRING filename
DECLARE INTEGER xlBookSaveA in libxl.dll LONG handle , STRING filename
DECLARE LONG xlBookAddSheetA in libxl.dll LONG handle , STRING name , LONG initSheet
DECLARE xlBookReleaseA in libxl.dll LONG handle
DECLARE STRING xlSheetReadStrA in libxl.dll LONG handle , INTEGER row , INTEGER col , LONG @format
DECLARE INTEGER xlSheetWriteStrA in libxl.dll LONG handle , INTEGER row , INTEGER col , STRING value , LONG format
DECLARE DOUBLE xlSheetReadNumA in libxl.dll LONG handle , INTEGER row , INTEGER col , LONG @format
DECLARE INTEGER xlSheetWriteNumA in libxl.dll LONG handle , INTEGER row , INTEGER col , DOUBLE value , LONG format
请问:如何输出为xlsx格式的表?