Range.Text/Value returning the number 3?

G

Grant

Hi,

I have already posted this (similar) question in the forum
Excel.Programming, but was told to post it here instead.

I am using VB.Net (Interop) and when I try to retrieve a value from a cell
it returns the number 3 instead of the actual value that is in the cell.

It happens for some of my cells, but others seem to work fine - I have no
idea what is happening.

I use Range("B4").Value or Range("B4").Text and also tried
Range("B4").FormulaR1C1, but still get that strange number 3 turning up.

It works for other cells (B3 returns the correct value, etc) but not others.

I only have one workbook open, and I specify the worksheet then the range.

I know it seems strange, but maybe there's a but using Excel Interop?

Any ideas?

Thanks in advance,

Grant.
 
C

Cindy M.

Hi =?Utf-8?B?R3JhbnQ=?=,

What is actually in the cell? Is it a formula? Has a format been applied to
the cell?

If you use some VBA in another workbook (so as not to "dirty" this one) to
"read" the cell, does it display the same problem? If it does, we know the
problem is in the workbook, not in the Interop. Then I'd be tempted to send
you right back to Excel.Programming... But I'll try to be more open-minded and
helpful than those VBA-centered heads :)
I have already posted this (similar) question in the forum
Excel.Programming, but was told to post it here instead.

I am using VB.Net (Interop) and when I try to retrieve a value from a cell
it returns the number 3 instead of the actual value that is in the cell.

It happens for some of my cells, but others seem to work fine - I have no
idea what is happening.

I use Range("B4").Value or Range("B4").Text and also tried
Range("B4").FormulaR1C1, but still get that strange number 3 turning up.

It works for other cells (B3 returns the correct value, etc) but not others.

I only have one workbook open, and I specify the worksheet then the range.

I know it seems strange, but maybe there's a but using Excel Interop?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top