• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1021
  • Last Modified:

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

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.
  • 2
  • 2
1 Solution
Bob LearnedCommented:
Make sure that your project only has one reference to Microsoft.mshtml.dll.

Are you parsing an HTML document from a WebBrowser?

JPERKS1985Author Commented:

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
Bob LearnedCommented:
No, I mean under the References in the Solution Explorer.  If you don't see the References node, then select 'Show all files'.

JPERKS1985Author Commented:
That did it, thanks a ton for the help, it just got rid of 68 errors.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now