' ブックをロードします
Dim workBook As Infragistics.Documents.Excel.Workbook =
Infragistics.Documents.Excel.Workbook.Load("C:\Book1.xls")
Dim sampleSheet As Infragistics.Documents.Excel.Worksheet = workBook.Worksheets(0)
' セルの名前付き参照を定義します
Dim namedRefCell As Infragistics.Documents.Excel.NamedReference = workBook.NamedReferences.Add("NamedReferenceCell", "=Sheet1!$B$5", sampleSheet)
MessageBox.Show(namedRefCell.ReferencedCell.ToString())
' 領域の名前付き参照を定義します
Dim namedRefRegion As Infragistics.Documents.Excel.NamedReference = workBook.NamedReferences.Add("NamedRefRegion", "=Sheet1!$A$5:$A$10", sampleSheet)
MessageBox.Show(namedRefRegion.ReferencedRegion.ToString())
' 複数の領域の名前付き参照を定義します
Dim namedMultiRef As Infragistics.Documents.Excel.NamedReference = workBook.NamedReferences.Add("NamedMultiRegion", "=Sheet1!$A$1:$B$5,Sheet1!$D$5:$G$10", sampleSheet)
MessageBox.Show(namedMultiRef.ReferencedRegions(1).ToString())