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.

 

Question Info


Last updated June 4, 2019 Views 5,574 Applies to:
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)

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

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

How satisfied are you with this response?

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.

12 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

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

How satisfied are you with this response?

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.

73 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

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

How satisfied are you with this response?

Thanks for your feedback.