// ブックをロード
Infragistics.Documents.Excel.Workbook workBook =
Infragistics.Documents.Excel.Workbook.Load(inputStream)
Infragistics.Documents.Excel.Worksheet sampleSheet = workBook.Worksheets[0];
// セルの名前付き参照を定義します
Infragistics.Documents.Excel.NamedReference namedRefCell = workBook.NamedReferences.Add("NamedReferenceCell", "=Sheet1!$B$5", sampleSheet);
System.Diagnostics.Debug.WriteLine(namedRefCell.ReferencedCell.ToString());
// 領域の名前付き参照を定義します
Infragistics.Documents.Excel.NamedReference namedRefRegion = workBook.NamedReferences.Add("NamedRefRegion", "=Sheet1!$A$5:$A$10", sampleSheet);
System.Diagnostics.Debug.WriteLine(namedRefRegion.ReferencedRegion.ToString());
// 複数の領域の名前付き参照を定義します
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());