Click here to Skip to main content
Sign Up to vote bad
good
See more: C#ASP.NET
Hi Friends
 
I am stuck up with a problem.I would be grateful to you people if anyone of you help mein solving my problem.
 
Actually I want to invoke an Excel application through my C# .Net program.For that I added the
 
using Excel= Microsoft.Office.Interop.Excel;
 
For that I did as below-->
 
My application->RC->Add Referenece->COM->Microsoft Excel 12.0 Object Library.
 
I did not find Microsoft.Office.Interop.Excel;
 
Now at Complie time I am getting a error as-->
 
The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
 
Am I missing anything or doing something wrong?
Can anybody help me for solving this problem??
 
Thanking in Advance.
 
Swapnil Borkar
(Software Trainee)
Posted 9-Mar-10 19:12pm
Edited 9-Mar-10 19:40pm


5 solutions

You need also to add a reference to the Microsoft Office 12.0 Object Libray, for the base support for office interop. See this article[^] for more information.
  Permalink  
I don't think you want to add a reference to the COM library if you're using C#. You want the Primary Interop Assemblies, but you'll have to check the MSDN documentation for where to find them. I think their presence also depends on the version of Visual Studio you're using (I don't think the Express editions include them, for example).
 
A good place to start might be creating an Office plug-in project in Visual Studio and seeing what the references end up being.
 
Altenrativly, have a look in Object Browser to see what namespace the Excel Object Library has been put in. Be warned, however, that this is not the recommended way of doing things.
  Permalink  
AddReference->.NET->
Microsoft.Office.Interop.Excel.
  Permalink  
No I cant find Anything. I downloaded some exe for fix tat issue And Installed too..
 
But Nothing Working Out .. please give me suggestion
  Permalink  
Comments
Wes Aday - 3-Aug-12 7:50am
How is this a solution to this 2 year old question?
Sandeep Mewara - 3-Aug-12 14:59pm
This is not an answer. Please use 'Have a Question or Comment' link to respond to an answer. It will notify answerer of your comment such that he can come back and reply. Or if needed, post a NEW question to share your issue and take help. http://www.codeproject.com/Questions/ask.aspx
sarathkumarnallathambi - 4-Aug-12 3:29am
No I cant find Anything. I downloaded some exe for fix tat issue And Installed too.. But Nothing Working Out .. please give me suggestion
Add the "Microsoft.Office.Interop.Excel.dll" to your C# project reference from the following path
 
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14\Microsoft.Office.Interop.Excel.dll
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Christian Graus 448
1 Ron Beyer 286
2 samadhan_kshirsagar 229
3 OriginalGriff 223
4 Tadit Dash 213
0 Sergey Alexandrovich Kryukov 7,017
1 Prasad_Kulkarni 3,815
2 OriginalGriff 3,557
3 _Amy 3,372
4 CPallini 3,010


Advertise | Privacy | Mobile
Web01 | 2.6.130619.1 | Last Updated 9 Aug 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid