Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Upgrading code from Vb.NET 2003 to 2008 , 'HTMLElementCollection' is ambiguous in the namespace 'mshtml'.

Posted on 2007-12-04
4
1,001 Views
Last Modified: 2013-11-26
I'm upgrading a very large app to vb.net 2008 from 2003 and I'm running into a lot of issues. I get this error "'HTMLElementCollection' is ambiguous in the namespace 'mshtml'."


My code:

Dim all As mshtml.IHTMLElementCollection = doc.getElementsByTagName(strTagName)
       

I've tried

Dim all As IHTMLElementCollection = doc.getElementsByTagName(strTagName)

I get the same error, these were not present when my code was compiled in 2003. Ive taken option strict off and avoided a lot of warnings but this one needs to be fixed.
       
0
Comment
Question by:JPERKS1985
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20404841
Make sure that your project only has one reference to Microsoft.mshtml.dll.

Are you parsing an HTML document from a WebBrowser?

Bob
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 20404875
Bob,

Thanks for the reply, I am parsing an HTML document from a web browser. When you say only one reference do you mean as far as imports or under references?

Option Strict Off


Imports System.IO
Imports System.Text
Imports System.Text.RegularExpressions
Imports System.Diagnostics
Imports System.Collections
Imports System.Threading
Imports System
Imports System.Xml
Imports System.Data
Imports System.Net
Imports System.Data.Common
Imports System.Data.OleDb
Imports System.ComponentModel
Imports DidChat
Imports mshtml
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 20405081
No, I mean under the References in the Solution Explorer.  If you don't see the References node, then select 'Show all files'.

Bob
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 20405115
That did it, thanks a ton for the help, it just got rid of 68 errors.
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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