You need to first create a reference in your project to the COM Microsoft Excel Object Library. Then you will have access to the object model inside of your project. Here is some sample code to use once you have your reference in your project:
Excel.Application oXL;
Excel.Workbooks oWBs;
oXL = new Excel.Application();
oWBs = oXL.Workbooks;
Here is an article about how to work with Excel in C# that you might find useful:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306023>Dear All
>
>I just began to write the C# program.
>I want open a excel file to be my import data file.
>In VB I alway use the CreateObject() to call Excel.
>But now in C# I can't find the CreateObject Function
>Please anyone can tell about it?
>
>Thank you
>
>T.S.
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi