Forum Discussion
frank_vanderstr
9 years agoContributor
Using .Item seemed to do the trick.
Next problem I am facing now is that using that pathway, I do not have access to the Cells function for the worksheet as shown in my code here where I populate my array with the data found in the given row of the worksheet.
for(var colcounter = column; colcounter <= colend; colcounter ++) {
var testcell = VarToStr(xlsheet.Cells(row, colcounter).Value);
rowdata[arraycounter] = testcell;
arraycounter +=1;
}
Using the Item object does it have a similar function to get cell data?
HKosova
Alumni
9 years agoWell, Cells is also a collection so you also need .Item.
Also, Object Browser shows that Value requires a range parameter, so you might want to use Value2 instead (at least if you use Excel 2010 like me).
var testcell = VarToStr(xlsheet.Cells.Item(row, colcounter).Value2);