0

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

Community
  • 1
  • 1
Luca
  • 918
  • 2
  • 13
  • 30

1 Answers1

1

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
Ugur
  • 1,257
  • 2
  • 20
  • 30