BindToMoniker Excel : Excel : Windows C# Examples


C# Examples » Windows » Excel »

 

BindToMoniker Excel









    
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();
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Windows
» Excel