Dim ExcelApp As Object = Nothing 'Excel.Application
Dim Books As Object = Nothing 'Excel.Workbooks
Dim Book As Object = Nothing 'Excel.Workbook
Dim Sheets As Object = Nothing 'Excel.Worksheets
Dim rng As Object 'Range オブジェクト
ExcelApp = CreateObject("Excel.Application")
Books = ExcelApp.Workbooks
' 既存の Excel ブックを開く
Book = Books.Open(prtypXlsFileInfo(intFileNo).strFullPath)
Sheets = Book.Worksheets
rng = DirectCast(Sheets.Cells(iRow, iCol), Excel.Range)
Messagebox.Show(rng.Text.ToString()) 'セルの内容
'毎回表示されるメッセージ『変更を保存しますか?』を出さないようにする。
ExcelApp.DisplayAlerts = False
Book.Close()
Books.Close()
ExcelApp.Quit()
' COM オブジェクトの参照カウントを解放する
System.Runtime.InteropServices.Marshal.ReleaseComObject(Sheets)
System.Runtime.InteropServices.Marshal.ReleaseComObject(Book)
System.Runtime.InteropServices.Marshal.ReleaseComObject(Books)
System.Runtime.InteropServices.Marshal.ReleaseComObject(ExcelApp)