I need to be able to parse the formulae in some excel cells. Specifically, I want to be able to determine which elements of the formulae consist of operators, inherent functions, UDFs, range addresses, named ranges and, crucially, which are undefined names.
Obviously, I could write this from scratch by checking for keywords and so forth, but that would be quite a complex task. However, it occurs to me that excel itself must do this internally - i.e. it must know what a formula "means" before it can execute it. Therefore it must have some form of internal representation of the formula in which each entity is categorised into one of the above groups (operator, address etc).
Does anybody know if this internal formula breakdown is accessible in any way? If so, how? Is there any way, in VBA, in which I can see the structure into which Excel internally parses a formula in a given cell?
Thanks, in advance,
Tony
Obviously, I could write this from scratch by checking for keywords and so forth, but that would be quite a complex task. However, it occurs to me that excel itself must do this internally - i.e. it must know what a formula "means" before it can execute it. Therefore it must have some form of internal representation of the formula in which each entity is categorised into one of the above groups (operator, address etc).
Does anybody know if this internal formula breakdown is accessible in any way? If so, how? Is there any way, in VBA, in which I can see the structure into which Excel internally parses a formula in a given cell?
Thanks, in advance,
Tony