I am trying to allow the user to be able to create or edit formulas used in a program.
Use a math parser.

Use MY math parser

you find it in signature, it's flexible and faster than Microsoft Script Control