Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't read an Excel cell with formula...

Status
Not open for further replies.

jacktripper

Programmer
Dec 5, 2001
124
US
I have a script which writes to an excel sheet and saves it. Once the cells have values, another column runs calculates on those cells. When I open the sheet afterwards, the formula cells all look correct.

BUT, when I try to use VB to read from those formula cells, all it returns is "001" when using the Cells(x,y).Value command. How can I get the calculated results of the formula and not this useless integer?
 
hi,

Well
1) what value is displayed in the actual cell and
2) what is your formula for that cell and
3) what are the values in the referenced cell(s)?

Please provide an answer for all 3 parts of my question.


Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
When you create the spreadsheet, do you force a recalculation prior to saving it? I'm wondering if the cells are marked as dirty, but since you're operating programmatically, nothing is forcing a recalc. If the formulae aren't recalculated, they may report a code (like 001) indicating they do not have anything for .Value.
 
Ack. Turns out I am an idiot. I've been looking at this for hours and just now noticed that there are lots of hidden columns. So, when referencing the cell I was hitting the wrong one with the number I was using for the col. UGH!

Well, thanks for replying anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top