Access an Excel cell in C #

Cell A1 contains the value "= A2" Cell A2 contains "Microsoft".

When I access cell A1 using C #, I get "Microsoft".

How to access the value "= A2" of cell A1?

Microsoft.Office.Interop.Excel.Range cell //it points to address A1 object obj=cell.Value2; //Here obj contains "Microsoft" but I want "=A2" 
+4
source share
1 answer

Try using Range.Formula:

 Microsoft.Office.Interop.Excel.Range cell //it points to address A1 object obj=cell.Formula; 
+4
source

Source: https://habr.com/ru/post/1338415/


All Articles