View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Matthew Wieder Matthew Wieder is offline
external usenet poster
 
Posts: 48
Default Excel4 Call to get Function String

Yeah - I somehow combed ine net and discovered that same code segmant
which should do what I want, but the call to xlfGetFormula is failing
with a return code of 2 or "An invalid function number was supplied. If
you are using constants from XLCALL.H, this shouldn't happen." I checked
XLCall.h and xlfGetFormula is correctly defined as 106. I hope we can
solve this issue as it has become somewhat urgent for us.
thanks!

Rob Bovey wrote:

"Matthew Wieder" wrote in message
...

That is what I need, but I need the actual string, not aa version I can
reconstruct. The difference is that I need to know whether a single
cell was entered as "$B$1" or as "B1:B1" which are equivalent once the
become passed in as XLOPERS so I need to get the actual string from the
cell.



Hi Matthew,

I've never tried to do this, so I don't know for sure that there's a
solution. The following seems like it ought to work:

XLOPER xlRef, xlFormula;
Excel4(xlfCaller, &xlRef, 0);
Excel4(xlfGetFormula, &xlFormula, 1, &xlRef);

but in the quick tests I've done it doesn't. I'll play with it some more
when I get back home tonight. and post again if I can get it working.