Skip to content

A row range reference returns the whole usedrange wrongfully.  #1267

@lyc0826

Description

@lyc0826

ExcelRange row = worksheet.Cells[i, 1, i, worksheet.Dimension.End.Column];
string key = row[1, 1].Text;

The codes above were supposed to get the text of the first column of the row “i“ ; however, actually I got the text of the first row and the first column of the whole usedrange, namely, the cell "A1".

I tried further, to replace the codes with the following:
ExcelRange row = worksheet.Cells[worksheet.Dimension.Address];
string key = row[1, 1].Text;
And I still got the the text of the first row and the first column of the whole usedrange, namely, the cell "A1".

That's to say, "worksheet.Cells[i, 1, i, worksheet.Dimension.End.Column];" equals "worksheet.Cells[worksheet.Dimension.Address];" in my situation, which seems wrongful.

Is it a bug or a purposeful design? Hope to hear from you soon.
Thank you and have a nice day!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions