Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Office VB10.0 Excel
hello,
 
I was building an application under vb.net 2008 which worked OK.
Now, I was trying to migrate it into vb.net 2010 and I still receive errors relate to different ambiguous in namespace Microsoft.Office.Interop.Excel. This is refering to DataTable, Workbook, Worksheet, Application.
 
After few researches o the net about this error, it seems to be in vb.net 2008 and not due to migration.
 
Does anyone have any idea why it is happening.
 
Thanks a lot,
Mikcutu.
Posted 30-Sep-12 8:48am
mikcutu374
Comments
Sandeep Mewara at 30-Sep-12 14:00pm
   
You talk of an error but don't share. How would anyone comment?
Sergey Alexandrovich Kryukov at 30-Sep-12 14:07pm
   
Well, I thing I can :-). I agree with you if you mean that the question is incomplete, but the general recommendation helps -- please see my answer.
--SA
ridoy at 30-Sep-12 16:18pm
   
As you are transferring your 2008 projects to 2010 then normally there will conflict between the namespaces of 2 versions for which it shows those ambiguous errors to respective dll files/namspaces
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

well, starting from your Sergey's solution, I was looking closely to the references and saw there are few other references to Office (different versions).
 
I just removed all of them and added the right one (Microsoft.Office.Interop.Excel) and it passed over this error.
 
...just hope this will help the future beginners as me and thank you all who spent some time to get a look on my question.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

No, it is not ambiguous is you reference proper assembly. With Visual Studio, for example, you need to reference an assembly using the ".NET" tab of the "Add Reference" window. When you do it, you add the reference to the "interop" assembly for a specific Office version. You will see the reference in the list in this window.
 
—SA
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Your Question is not clear.
but take a look here it may help full for you.
I had also face situation similar to this.
In my case "the error is an ambiguous reference between
System.Windows.Forms.Label and
ZedGraph.Label"
actually both of these name spaces having same class name Label
when i create a variable of Label then system confuses what is meant by Label is it form ZedGraph or System.Windows.Forms.
i solve this problem by this.
 
using System.Windows.Forms;
using ZedGraph;
using zedLabel = ZedGraph.Label;
using Label = System.Windows.Forms.Label;  // here i am explicitly telling what i mean of Label so the System do not confuse with Other Object having same name in other namespace
when i want to create a object of type ZedGraph.Label then i use
 
ZedGraphLabel  Objec = new ZedGraphLabel()

if i create an object like this.
   // it creates a label of type System.Windows.Forms.Label;
  Label l = new Label();
and an other way is this use complete reference . like this
  
  Zedgraph.Label objLabel = new Zedgraph.Label(); 
  System.Windows.Forms.Label objLabel2 = new System.Windows.Forms.Label();
 
I hope you understand..
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 535
1 OriginalGriff 275
2 BillWoodruff 260
3 Shweta N Mishra 244
4 Deepu S Nair 230
0 OriginalGriff 6,168
1 Sergey Alexandrovich Kryukov 5,818
2 DamithSL 4,958
3 Manas Bhardwaj 4,539
4 Maciej Los 3,755


Advertise | Privacy | Mobile
Web03 | 2.8.1411019.1 | Last Updated 1 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100