I\'m trying to get a range from Excel, which has multiple areas specified, essentially I\'ve got...
int StartColumn
int EndColumn
int[] ColumnsToSkip
Try this:
using Excel = Microsoft.Office.Interop.Excel;
Excel.Range[] ranges = new Excel.Range[] {yourRange1, yourRange2, ... };
string multiRangeStr = "";
foreach (Excel.Range range in ranges)
{
string address = range.Address[true, true, Excel.XlReferenceStyle.xlA1];
multiRangeStr += (multiRangeStr == "" ? "" : ";") + address;
}
//output: multiRangeStr: "A1:A3;B1:B3"
Excel.Range multiRange = wsheet.Range(multiRangeStr);