View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
John Coleman John Coleman is offline
external usenet poster
 
Posts: 274
Default Looking For A Specific Formula Programmatically


Johnny Meredith wrote:
Thanks for the reply. I really hadn't considered the RAND() issue, but
generally speaking, the formulas that are being frozen are wrappers for
queries into an accounting system. The creators of these sheets often
times have to send their results to people who do not have access to
the accounting system, so the values of the subexpressions in this
application are readily determinable.

I'm trying to avoid parsing strings altogether. That's what I'm doing
now. The problems with this methodology just seems to keep
snowballing. I want to know if there's a way to use Excels built-in
formula evaluations algoritims to solve this problem. I'm quite
certain that Excel does not parse strings to identify formulas in a
cell, but then again, I could be wrong.

I'm probably way out in left field here, but you never know!

Thanks for the quick response and excellent observations,
Johnny


It doesn't sound quite so bad. Excel undoubtably parses formulas to
some sort of tree representation, but the later is not exposed by VBA.
If the expressions you want to replace have the property that you can
use VBA to determine their value then it might be possible to use
regular expressions to pick them out and do the substitution. Are you
familar with VBScript's RegExp object? It can be used from Excel by
setting an appropriate reference.

I'm off to the parents now for a Christmas dinner. Good luck with your
problem.

-John Coleman