static void ImportExcel(Args _args) { SysExcelApplication application; SysExcelWorkbooks workbooks; SysExcelWorkbook workbook; SysExcelWorksheets worksheets; SysExcelWorksheet worksheet; SysExcelCells cells; FileName filename; LabelId labelId; str st1, st2; int row = 0 ; SysLabelEdit SysLabelEdit = new SysLabelEdit(); application = SysExcelApplication::construct(); workbooks = application.workbooks(); //specify the file path that you want to read filename = "D:\\importtest.xlsx"; try workbooks.open(filename); catch (Exception::Error) throw error("File cannot be opened."); workbook = workbooks.item(1); worksheets = workbook.worksheets(); worksheet = worksheets.itemFromNum(1); cells = worksheet.cells(); do { row++; labelId = "@" + cells.item(row, 1).value().bStr(); SysLabelEdit.labelModify('en-us', labelId, cells.item(row,2).value().bStr(), cells.item(row, 3).value().bStr(), SysLabelApplModule::None); } while (row != 4); application.quit(); }
↧
RE: Import label language from excel file to ax
↧