标签:books lte ati div top tar port ksh upd
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"); } }
标签:books lte ati div top tar port ksh upd
原文地址:http://www.cnblogs.com/zoao/p/6762241.html