0

I have an excel sheet with 98 columns and 58 rows I saw that with code

IXLRow row = ws.Row(6);

the line takes the A6 column to the last XFD6. There is the option to take only up to 98 or say to take only the columns are not empty?

Thank you

fede186
  • 89
  • 8

2 Answers2

1

If you're after specifically IXLRow, I don't think it's possible. If you're after getting or setting values for the specific range, you might want to check either Cells property of the worksheet:

ws.Cells(1,1)

or the Range property of the Worksheet:

ws.Range("A1", "CT58")

parvee
  • 98
  • 10
  • after I made ws.Range("A1", "CT58") how I can get the values of the cells? – fede186 Nov 25 '16 at 13:57
  • By using a `.Value` or `.Value2` property of the Range you get. If you want more specific answer, you need to provide more context to your question. There are examples in the links I have provided. You might also want to check http://stackoverflow.com/questions/23004274/vb-net-excel-worksheet-cells-value – parvee Nov 25 '16 at 14:19
0

Where the range is multiple cells: an array

Excel.Worksheet sheet = workbook.ActiveSheet;
Excel.Range rng = (Excel.Range) sheet.get_Range(sheet.Cells[1, 1], sheet.Cells[3,3]);

Where range is one cell: a string

Excel.Worksheet sheet = workbook.ActiveSheet;
Excel.Range rng = (Excel.Range) sheet.Cells[1, 1];