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!

Having trouble with Excel in DataSet

Status
Not open for further replies.

roleki

Technical User
Sep 5, 2007
22
0
0
US
I'm using a DataSet to help me map out relevant cell coordinates in an Excel file; I'm using

DataSetName.Tables(TableNum).Rows(RowNum)(ColNum).ToString()

to get to the relevant bits. This had been working out, but I ran into a problem - I can't seem to access a group of merged cells that are next to a contiguous merged cell... It's difficult to explain without a graphic, but it's like this:

Say R24:T28 are merged into a single cell, then next to them, U24:V24 is merged, U25:V26 is merged, then U27:V28 is merged.

Coordinates for R24:T28 are 24,17, and for U24:V24 is 24,20. Coordinates for U25:V26 should be 25,20, but the value in that cell keeps coming back '', even though it plainly has data in it. No amount of pecking around has dredged up the contents of the cells in U25:V26.

Anyone have any ideas around something like that?
 
When placing data in the merged cell the full cell range needs to be selected. If you are doing cell() then U25:V26 is cell 25,21 to cell 25,22. If you just select 25,20 then first it is wrong, but so is 25,21 as you have to select the full merged cells.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Hm; if that's the case then my current approach is going to be problematic because .Row(x)(x) only accepts ints for x.


Thanks for pointing that out :)

Back to the drawing board, I suppose.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top