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

Answers


Ugur February 2016

Please check that out:

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

Here, Range is :

Microsoft.Office.Interop.Excel.Range

Post Status

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

Search




Leave an answer