Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

Need 1 more line of code to make the xls worksheet calculate

$
0
0

I have this code to update the value of an Excel cell in A1:

objConn.Open();
OleDbCommand objCmdUpdate = new OleDbCommand("UPDATE[Sheet1$A1:A1] SET F1 = 2000", objConn);
objCmdUpdate.ExecuteNonQuery();

It is working and update cell A1 to 2000. However, my goal is to get the calculated value of cell B1 which has formula =20*A1
Now I use this line to get cell B1

new OleDbCommand("SELECT * from [Sheet1$B1:B1]", objConn2);

It is getting a value but it is getting cell value of B1 BEFORE using new A1 to calculate B1 cell value.

What is the code above to ensure the worksheet formula to calculate ?

Thanks


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>