Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1103
  • Last Modified:

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

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
melli111
Asked:
melli111
  • 3
1 Solution
 
Rajkumar GsSoftware EngineerCommented:
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
 
melli111SharePoint Administrator / DeveloperAuthor Commented:
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
 
Rajkumar GsSoftware EngineerCommented:

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
 
Rajkumar GsSoftware EngineerCommented:
In your namespace also check with the help of intellisense for
Microsoft.
0
 
Todd GerbertIT ConsultantCommented:
Have you added the appropriate Microsoft.Office.Interop... references to your project?
Untitled.png
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now