View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
SixSigmaGuy[_2_] SixSigmaGuy[_2_] is offline
external usenet poster
 
Posts: 5
Default creating Excel Application Object in C#?

Can someone tell me how to create an Excel Application object in C#? I can
create a Word and PowerPoint Application object, but when I try to create one
for Excel, I get the build error:

"Cannot create an instance of the abstract class or interface 'interface'"

After adding the appropriate references, I use the following code to create
a Word and PowerPoint Application object:

Word.Application wdApp = new Word.Application();

PowerPoint.Application ppApp = new PowerPoint.Application();

But when I try it with Excel,

Excel.Application xlApp = new Excel.Application();

I get the build error I showed above.

I've searched VS help and MSDN and haven't found any examples that do what
I'm trying to do.

I have references to:
Excel
Microsoft.Office.Core
Office

in my project. Is there some other reference I need?

Thanks!

BTW, I'm on a boat in the middle of the Atlantic for the next two weeks and
I'm using a very slow satelitte connection that's costing me $42/hr. If I
sent this to the wrong newsgroup, could you please forward it to the right
one for me so I don't have to waste connect time? Thanks!