程序代码:
SET SAFETY OFF CREATE CURSOR tt (操作员 V(10), 采购合同号 V(20), 供应商 V(30), 签约日期 V(10),; 交货日期 V(10), 产品编码 V(10), 规格编号 V(20), 商品名称 V(30),; 规格说明 V(100), 商品总量 I, 单位 V(10), 币种 V(10), 采购金额 N(12,2)) cPath = ADDBS(JUSTPATH(SYS(16))) SET DEFAULT TO (cPath) cXLS = cPath + "pupi_CUR_TEST.xls" cTXT = cPath + "pupi_CUR_TEST.txt" oExcel = NEWOBJECT("Excel.Application") WITH oExcel .WorkBooks.Open(cXLS) .ActiveSheet.UsedRange.Select WITH .Selection .Columns.WrapText = .F. .Columns.AutoFit nRow = .Rows.Count - 1 nColumn = .Columns.Count LOCAL ArrayName[nRow, nColumn] ArrayName = .Cells(2, 1).Resize(nRow, nColumn).Value ENDWITH INSERT INTO TT FROM ARRAY ArrayName .DisplayAlerts = .F. .WorkBooks.Close .Quit ENDWITH BROWSE
[此贴子已经被作者于2021-5-28 16:05编辑过]
坚守VFP最后的阵地