![]() |
#12 |
Участник
|
В продолжение темы взаимодействия с Excel...
![]() PHP код:
Цитата:
Parameters
Formula Required Object. A String that contains the formula you want to convert. This must be a valid formula, and it must begin with an equal sign. FromReferenceStyle Required XlReferenceStyle. The reference style of the formula. XlReferenceStyle can be one of these XlReferenceStyle constants: xlA1 xlR1C1 ToReferenceStyle Optional XlReferenceStyle. The reference style you want returned. If this argument is omitted, the reference style isn't changed; the formula stays in the style specified by FromReferenceStyle. X++: #define.xlRefStyleA1 (1) #define.xlRefStyleR1C1 (-4150) //(0xffffefca) // _rows, _cols - dimensions of the range area // _bookmark - the upper-left corner of the range protected Bookmark getXlRangeAddress(Bookmark _bookmark, int _rows, int _cols) { COM range; COM app; str strAddr; str strRet; ; if(!excel) throw error("@SYS54192"); if(_rows<1 || _cols<1) throw error(error::wrongUseOfFunction(funcname())); range = excel.my_findRange(_bookmark); strRet = range.address(); if(_rows>1 || _cols>1) { app = range.application(); // convert _bookmark's upper-left cell address to R1C1 format strAddr = app.convertFormula(strRet, #xlRefStyleA1, #xlRefStyleR1C1); if(!strAddr) throw error(@"Ошибка при вызове Application.ConvertFormula!"); strAddr = strAddr + @":R" + int2str(range.row()+_rows-1) + @"C" + int2str(range.column()+_cols-1); strRet = app.convertFormula(strAddr, #xlRefStyleR1C1, #xlRefStyleA1); } return strRet; } ![]() X++: strAddr = app.convertFormula(strRet, #xlRefStyleA1); PHP код:
Код: $J$4 == R4C10 R4C10:R27C11 == $J$4:$K$27 ![]() Последний раз редактировалось gl00mie; 30.03.2007 в 16:32. |
|
|
![]() |
||||
Тема | Ответов | |||
Построчный импорт из Excel через COM | 20 | |||
Ошибка COM-объекта | 15 | |||
Ошибка com 0x800A9C68 | 2 | |||
Работа с Excel через COM в DAX 4.0 | 4 | |||
DLL (BarCode) через COM | 4 |
|