Get cell contents literally through automation

T

Tuyen Hoang

I'm using Excel 2003 and trying to manipulate sheets with "C#" through Excel
automation.
If a cell has been entered with "=3 + 2", is it possible to get this
original string in stead of the calulated one "5"?
I tried <cell>.Formula but this returns "5"
 
R

Rick Rothstein

I don't use C#, so I don't know what the syntax would be; but, in VBA, you
would reference the Formula property of the cell rather than the Value
property. Here is what the VB code would look like...

MsgBox Range("A1").Formula
 
Top