Solved

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

Posted on 2008-06-16
4
2,343 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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