+ Reply to Thread
Results 1 to 17 of 17

code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

  1. #1
    Registered User
    Join Date
    07-20-2012
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    10

    code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    I had code that creates and IE object and opens a webpage, I write a black source file to my D drive and then populate that black text file with using the innerhtml property of IE. However this code now work in excel 2010 IE ver 9 at least the part where i'm trying to write the innerhtml. Below is the code with the line in question bolded
    Also the error i get is

    run-time error ;2147023179 (800706b5)
    Automation error
    The interface is unknonn


    Please Login or Register  to view this content.
    Last edited by Cutter; 07-20-2012 at 08:53 PM. Reason: Added code tags

  2. #2
    Registered User
    Join Date
    07-20-2012
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    Please anyone able to provide some help, i'm at a real loss here.

  3. #3
    Registered User
    Join Date
    07-20-2012
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    It seems that Excel 2010 is not recognizing the Internet Explorer object for some reason, anyone know if this is a setting or reference that needs to altered/added?

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    I tested your code, it works on excel 2010 on Win 7
    Last edited by patel45; 07-20-2012 at 02:59 PM.

  5. #5
    Registered User
    Join Date
    07-20-2012
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    I am still getting error at the ots.write (IE.document.documentelement.innerhtml) line. I'm using IE 9. This was working fine in IE 7. Any help is greatly appreciated.

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    Try this, avoid automating ie at all costs, it is extremely slow :
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    Quote Originally Posted by ycg0311 View Post
    I'm using IE 9......
    me too, I use IE 9, no problems

  8. #8
    Registered User
    Join Date
    07-20-2012
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    Thanks!!!! the code works great. However how can i get the html code in the file as opposed to just the text of the webpage?

  9. #9
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    Im not in front of a computer now, but try changing inner text to innerhtml

  10. #10
    Registered User
    Join Date
    07-20-2012
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    got it. Thanks man!

  11. #11
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    Actually just write the responsetext to the file and skip the html doc

  12. #12
    Registered User
    Join Date
    07-20-2012
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    One other question regarding this how do i use this the MSXML2.XMLHTTP object to access websites that have a login and pwd?

  13. #13
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    that's a lot more complicated. The WinHTTP Request object (which is very similar to the xml object) allows you to pass credentials, however the site has to be configured properly to accept them.

    It would be easier to automate ie.

  14. #14
    Registered User
    Join Date
    07-20-2012
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    for some reason when automating IE i'm to create the object and open the URL but for some reason cannot do anything with IE after that as i'm getting

    Automation Error
    The interface is unknown.

    Is there a reference in Excel VBA that needs to be checked perhaps?

  15. #15
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    No, not if you can create the object.

    Can you post the code you're using?

  16. #16
    Registered User
    Join Date
    07-20-2012
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    It taps out at the do loop for some reason

    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    07-20-2012
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    It taps out at the do loop for some reason

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1