Free Support Forum -


why do I get the ‘error CS1503: Argument ‘2’: cannot convert from ‘int’ to ‘byte’’ compilation error when calling


The ‘cells’ is of the Cells type and the ‘endSampleIndex’ of the int type.

The column index should be type of byte. So please change your code to:

cells[0, (byte)endSampleIndex].PutValue(“Value”);

And that is what I did. The question is; is it a bug in your code or does it serve some purpose?

It’s not a bug.
Column index is type of byte. In MS Excel, the total column number is 256. So we set column index as type of byte: from 0 to 255.

Make sence. Sorry, I should have known better.