Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Grant,
As Dave says, these error normally occur because you are not retrieving a value from the location you think. What do you get for Range("B4").Parent.name Range("B4").Parent.Parent.name What does this give ? Range("B4").Value="Test Value" Msgbox Range("B4").Value NickHK "Grant" wrote in message ... Hi Dave, I'm absolutely sure that it's picking up the correct worksheet, etc. I already specify the worksheet name followed by the range. It will pickup the correct values just around the cell B4 correctly, but returns 3 for that cell - and it also does the same thing for some other cells. I only have one workbook open at the time, and don't specify the workbook name anywhere. So if I tried to get the value in B3 it gives me the correct value, etc. I know it seems strange, but it happens for only some cells, and in different worksheets (not just one of them). Any help on this would be great - I'm not sure if there is some sort of bug retrieving values from VB.Net using the Interop? Thanks, Grant. "Dave Peterson" wrote: Are you sure you're picking up B4 from the correct worksheet? I'd qualify the range to see if that helped. workbooks("someworkbook").worksheets("somesheet"). range("b4").value Grant wrote: Hi, 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. Any ideas? Thanks in advance, Grant. -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
number range returning a text value | New Users to Excel | |||
Returning the row number of a cell in a range that matches a given condition | Excel Programming | |||
Returning the row number of a cell in a range that matches a given condition | Excel Programming | |||
Returning a value for a number in a range | Excel Discussion (Misc queries) | |||
Returning true if a number fits between a range | Excel Programming |