09.10.2008, 19:48 | #6 |
Модератор
|
Спасибо, вопрос закрыт.
по имени ячейки берем номер строки X++: public int getCellName_RowNum(MSOfficeBookMark_RU bookMark, int _workSheet = 1) { COM comRange, comWorkSheet; COM comApplication; if (m_comDocument) { comWorkSheet = this.getWorkSheet(_workSheet); comApplication = m_comDocument.application(); comWorkSheet.activate(); if (comWorkSheet && comApplication) { comRange = comApplication.range(bookMark); } } return comRange.Row(); } X++: public int getCellName_ColumnNum(MSOfficeBookMark_RU bookMark, int _workSheet = 1) { COM comRange, comWorkSheet; COM comApplication; if (m_comDocument) { comWorkSheet = this.getWorkSheet(_workSheet); comApplication = m_comDocument.application(); comWorkSheet.activate(); if (comWorkSheet && comApplication) { comRange = comApplication.range(bookMark); } } return comRange.Column(); } X++: static void Job104(Args _args) { ComExcelDocument_RU doc = new ComExcelDocument_RU(); ; doc.open("C:\\test.xls"); doc.insertValue("test", 100); info('Row='+int2str(doc.getCellName_RowNum('test')) + ' Col='+ int2str(doc.getCellName_ColumnNum('test')) ); doc.insertClearRow(2); doc.insertValue("test", 200); doc.visible(true); } |
|