tags:

views:

346

answers:

3

I am parsing thorugh a 2000+ record excel file, and need ot be able to grab the formula itself from the cells and not just the value. For example, one cell 'Contributions' may be a single number like 1500 or it can be a few numbers 1500+500-200 but I dont want the total, I want the actual formula so I can get the different numbers.

I was just parsing with an oledbconnection and that only seems to get me the total. How would I go about getting the formula? Is it possible (I can get it in either XLS or XLSX)?

Thank you.

+1  A: 

A quick google found the following: http://codingsense.wordpress.com/2009/03/01/get-all-formula-from-excel-cell/

Mitch Wheat
grrrrr... blocked from work, I'll have to check this from home
Stuck In Baghdad
A: 

The xslx is an xml file so it should be easy enough to read. Alternatively you can use third-part components like the one from Infragistics that allows you to read xsl-files programmatically and also to access the formulas.

Rune Grimstad
+1  A: 
Patrick McDonald
can you explain more about this?What kind of object is 'worksheet'? How do I get one :P
Stuck In Baghdad