Solved

C# error " The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)"

Posted on 2011-02-14
5
1,035 Views
Last Modified: 2012-05-11
I get the error message

 The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

when I attempt to run the C# code from my page.  I have already included the reference to the Micorosft.Office.Excel namespace in my code, which is why I am confused.
0
Comment
Question by:melli111
  • 3
5 Comments
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34889600
It could be due to lack of proper assembly. You may have older version.
Try download from here and refer it in your project
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C41BD61E-3060-4F71-A6B4-01FEBA508E52&displaylang=en
0
 
LVL 15

Author Comment

by:melli111
ID: 34890246
I am using Office 2007, with the .xlsx extension.  This link appears to be for Office 2002, and the file I am using is for Office 2007.  Will thi slink be suitable for this case?
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34890306

Check in your GAC for the exact assembly name?

I assume, it would be
Micorosft.Interop.Office.Excel
instead of
Micorosft.Office.Excel

Try
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34890332
In your namespace also check with the help of intellisense for
Microsoft.
0
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 500 total points
ID: 34890383
Have you added the appropriate Microsoft.Office.Interop... references to your project?
Untitled.png
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now