首页 > 代码库 > AX_SysExcel
AX_SysExcel
void KTL_CPeng_ImportCustStamp() { str file; FileNameFilter filter = ["@SYS57521",‘*.xlsx‘, "@SYS101541",‘*.xls‘]; COMVariant COMVariant1; SysExcelApplication app; SysExcelWorkbooks Workbooks; SysExcelWorkbook Workbook; SysExcelWorksheets Worksheets; SysExcelWorksheet Worksheet; SysExcelCells Cells; SysExcelCell RCell1, RCell2, RCell3,RCell4,RCell5,RCell6,RCell7, RCell8; int i, j; #excel ; try { ttsbegin; file = Winapi::getOpenFileName(0, filter, ‘‘, "Open Excel Files"); app = SysExcelApplication::construct(); Workbooks = app.Workbooks(); COMVariant1 = new COMVariant(); COMVariant1.bStr(file); Workbook = Workbooks.Add(COMVariant1); Worksheets = Workbook.worksheets(); Worksheet = Worksheets.itemFromName("sheet1"); //Worksheet = worksheets.itemFromNum(1); Cells = Worksheet.Cells(); i = 2; // first line is a title, start line 2 RCell1 = Cells.Item(i, 1); RCell2 = Cells.Item(i, 2); RCell3 = Cells.Item(i, 3); RCell4 = Cells.Item(i, 4); RCell5 = Cells.Item(i, 5); RCell6 = Cells.Item(i, 6); RCell7 = Cells.Item(i, 7); RCell8 = Cells.Item(i, 8); while (RCell1.value().bStr() != "") { print Cells.item(i, 1).value().bStr(); // add code i++; RCell1 = Cells.item(i, 1); RCell2 = Cells.Item(i, 2); RCell3 = Cells.Item(i, 3); RCell4 = Cells.Item(i, 4); RCell5 = Cells.Item(i, 5); RCell6 = Cells.Item(i, 6); RCell7 = Cells.Item(i, 7); RCell8 = Cells.Item(i, 8); } ttscommit; info(strfmt("%1 %2 %3", "Update Complete", i-2, curext())); } catch { info("Nothing Uploaded"); } }
AX_SysExcel
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。