Home Ask Login Register

Developers Planet

Your answer is one click away!

Luca February 2016

C#/WPF: Defining an EXCEL range through row and column number

I have tried this

How do I get an Excel range using row and column numbers in VSTO / C#?

but it throw an undefined com exception

what I would like is something like (pseudocode)

Range myRange = new Range(new cell(1,1), cell(3,3));

so that I can then use it with (pseudocode again)

ws.myRange.Interior.Color = XlRgbColor.rgbDarkGray;

thank you


Ugur February 2016

Please check that out:

Range range1 = ws.Range[ws.Cells[1, j], ws.Cells[1, j+1]];

Here, Range is :


Post Status

Asked in February 2016
Viewed 2,092 times
Voted 13
Answered 1 times


Leave an answer

Quote of the day: live life