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,048 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run tasks synchronously in background thread 19 82
Removing Version of .NET in Windows 10 17 128
convert Absolute path to relative path of FTP location 7 50
Pdf not loading 2 39
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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