Solved

What does this error message mean?   Application is ambiguous in the namespace microsoft.office.interop.excel

Posted on 2008-06-16
4
2,345 Views
Last Modified: 2010-04-21
I was working on my project, inserted an excel snippet by mistake and after I removed the snippet my program has errors all over where I reference Microsoft.Office.Interop.Excel

I get this error code:  Application is ambiguous in the namespace microsoft.office.interop.excel

What does it mean?  How can I make my program work again?
0
Comment
Question by:logoncom
  • 2
4 Comments
 
LVL 18

Assisted Solution

by:Wakeup
Wakeup earned 200 total points
ID: 21798054
This seems similar to your problem.  I'm no VB guru at all, just thought this may be applicable...If it's not sorry! :)

http://msdn.microsoft.com/en-us/library/aa164018(office.10).aspx
0
 
LVL 24

Accepted Solution

by:
purplepomegranite earned 300 total points
ID: 21798179
Yes, that article does explain the problem.  You are declaring object as application, but not being more specific.  You now have more than one object to which application applies, so Visual Studio cannot determine which you are referring to.

You need to go through and identify all your application declarations e.g.

dim x as application

Change these to the specific application you are declaring e.g.
Dim x as Microsoft.Office.Interop.Excel.Application

Or, if you are not using any Excel code anymore, you could go through and delete any Microsoft Office imports, e.g.
Imports Microsoft.Office.Interop.Excel
0
 

Author Closing Comment

by:logoncom
ID: 31467794
you answer did not directly help answer my problem but it did make me realize what I did.  By adding the excel snippet I did not want to add... it added a reference to excel that did not belong in my project... as soon as I removed the reference, all was good again.  Thanks.
0
 
LVL 18

Expert Comment

by:Wakeup
ID: 21798948
Hey thanks for the points!  I appreciate it! :)  Glad you were able to fix the problem!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

808 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