Solved

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

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

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 17

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

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

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…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

920 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

14 Experts available now in Live!

Get 1:1 Help Now