ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get cell contents literally through automation (https://www.excelbanter.com/excel-programming/422847-get-cell-contents-literally-through-automation.html)

Tuyen Hoang

Get cell contents literally through automation
 
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"

Rick Rothstein

Get cell contents literally through automation
 
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

--
Rick (MVP - Excel)


"Tuyen Hoang" wrote in message
...
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"




All times are GMT +1. The time now is 12:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com