BindToMoniker Excel : Excel « Windows « C# / CSharp Tutorial






using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Excel;

class MainClass
{
  [STAThread]
  static void Main(string[] args)
  {
    Excel.Workbook MyWorkBook;
    Excel.Worksheet MyWorkSheet;
    string FileName = @"C:\Mybook.xls";

    MyWorkBook = (Excel.Workbook)Marshal.BindToMoniker(FileName);
    MyWorkSheet = (Excel.Worksheet)MyWorkBook.ActiveSheet;
    System.Windows.Forms.Application.Run();
  }
}








29.15.Excel
29.15.1.Excel Interop Example
29.15.2.BindToMoniker Excel
29.15.3.Excel workbook event handlers