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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top