Excel "object library feature not supported"

Hi all-

I'm reusing some code from another project (another PC) and having some trouble getting it to work. I get the "object library feature not supported" error when I try to run the code, if I understand correctly this is a compile error.  I can't tell you what version of IE was on the original PC, but on the current PC it is IE9 (and can't be updated).

Is the information below sufficient for anyone to tell me what is going wrong here?

Here are my checked references:

Here is the code:

Sub Random()

'to refer to the running copy of Internet Explorer
Dim ie As InternetExplorer
'to refer to the HTML document returned
Dim html As HTMLDocument

'open Internet Explorer in memory, and go to website
Set ie = New InternetExplorer
ie.Visible = False


    ie.navigate http://www.mywebsitename.com/ 'this has a valid website name in the real code, I've replaced it with an anonymized URL
    Do While ie.readyState <> READYSTATE_COMPLETE
        DoEvents
    Loop
   
For i = 1 To 1 '1000

    ie.Refresh 
    Do While ie.readyState <> READYSTATE_COMPLETE
        DoEvents
    Loop
    Application.Wait (Now + TimeValue("0:00:01"))
   
    'text of HTML document returned
    Set html = ie.document  '<<-- this is what is highlighted as an error

etc.

I don't know it if matters, but I do not have administrative rights on this new PC. (I wouldn't think that should matter, but wanted to add it just in case)

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Many helpful sites are blocked by my employer's firewall, but I found this and it solved the problem:

http://www.mrexcel.com/forum/excel-questions/693594-compile-error-object-library-feature-not-supportted.html

unreference OLE automation, then re-reference, and the code seems to be working again.

19 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

You need only to re-order the References at RUN->References in VBA.

 

Putthe "Microsoft HTML Object Library" at the top of "OLE Automation" and your Sub will Works again.

101 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated May 7, 2024 Views 10,650 Applies to: