Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a function compiled into an xll add-in using a pascal version of the C-API for getting the formula in a cell as a string. It needs the row and column index of a cell and works fine. However, I would rather have a cell as parameter than its indices, giving a function like: function GetFormulaInCellXl(var CellXl: TXloper): PxlOper; stdcall; However I do not succeed in getting this right for xlfGetCell. It always returns #VALUE. (I can also manage it to crash excel) Question: How do you get the row,col values of a cell that is parameter to a function. (tips using C also welcome.) The essential lines of the working version are below: function GetFormulaXl(var RowXl, ColXl: TXloper): PxlOper; stdcall; .... .... get row and col from XlOpers RowXl, ColXl .... //Set reference ref.xlType := xltypesref; ref.val.sref.Count := 1; with ref.val.sref.xlref do begin firstrow := Row; firstcol := Col; lastrow := Row; lastcol := Col; end; tempInt.xlType := xlTypeInt; tempInt.val.int := 6; xlresult := _Excel4v(xlfGetCell, @ResultXlOper, 2, [@TempInt, @Ref]); //Returns the formula in the default reference style //xlfGetFormula would return R1C1 style //_Excel4v is excel4v with "asm pop sink end;" //for removing 4 bytes left by Excel4v function call end; result := @ResultXlOper; .... It is registered with 'PPP#' as type Thanks, Janwillem |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Janwillem,
Questions about Excel's C Api and xlls are generally answered in the Public.Excel.sdk newsgroup. You might like to repost your question there. Regards Stephen Bullen Microsoft MVP - Excel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Nesting a sheet name reference within a cell reference??? | Excel Discussion (Misc queries) | |||
Changing sheet reference to cell reference | Excel Worksheet Functions | |||
absolute cell reference A spreadsheet cell reference that does no | Excel Discussion (Misc queries) | |||
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. | Excel Worksheet Functions | |||
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable | Excel Worksheet Functions |