// Load a Workbook
Infragistics.Documents.Excel.Workbook workBook =
Infragistics.Documents.Excel.Workbook.Load(inputStream);
Infragistics.Documents.Excel.Worksheet sampleSheet = workBook.Worksheets[0];
// Define a Named Reference for a Cell
Infragistics.Documents.Excel.NamedReference namedRefCell = workBook.NamedReferences.Add("NamedReferenceCell", "=Sheet1!$B$5", sampleSheet);
System.Diagnostics.Debug.WriteLine(namedRefCell.ReferencedCell.ToString());
// Define a Named Reference for a Region
Infragistics.Documents.Excel.NamedReference namedRefRegion = workBook.NamedReferences.Add("NamedRefRegion", "=Sheet1!$A$5:$A$10", sampleSheet);
System.Diagnostics.Debug.WriteLine(namedRefRegion.ReferencedRegion.ToString());
// Define a Named Referene for Multiple Regions
Infragistics.Documents.Excel.NamedReference namedMultiRef = workBook.NamedReferences.Add("NamedMultiRegion",
"=Sheet1!$A$1:$B$5,Sheet1!$D$5:$G$10", sampleSheet);
System.Diagnostics.Debug.WriteLine(namedMultiRef.ReferencedRegions[1].ToString());