Hi Rui,
I see the problem with xlfGetFormula. I found xlfGetCell (GET.CELL)
(with parameter 6) which will give you the actual formula in whatever
reference style is current. Also useful might be xlfFormulaConvert
(FORMULA.CONVERT) which can convert the references in a formula to be
relative or absolute references.
You can download the official help file (XLMACR8.HLP) for the Excel
Macro language from here:
http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=94be9dfa-8a84-4155-b75f-f29b15d5629f
The translation from the Macros to XlCall.Excel(XlCall.xlc....) is
normally easy.
This doesn't answer your complete question. The formula in a cell
might have many functions, and they might be nested. To build the
reference tree you will have to parse the formulas yourself.
Getting the actual formula that is in a cell can be done with
xlfGetCell like this:
<ExcelFunction(IsMacroType:=True)>
Function GetCellInfo(<ExcelArgument(AllowReference:=True)>
InputReference As Object)
Dim formula As String
If TypeOf InputReference Is ExcelReference Then
formula = CStr(XlCall.Excel(XlCall.xlfGetCell, 6,
InputReference))
Return formula
Else
Return "Not a reference"
End if
End Function
Hope this helps.
--Govert--
> > <exceldna%2Bunsubscr...@googlegroups.c om>