+ Reply to Thread
Results 1 to 11 of 11

Information about html object library

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Information about html object library

    Hi all,

    I'm struggling with getting to know all the website-reading/operating related methods etc. For each small task I have to google myself through until I got it workin. Is there any book/website that explains interacting with websites? Would be great.

    Thanks!
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

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

    Re: Information about html object library

    The best thing to do would be to get a grasp of HTML, there are loads of resources out there for doing that. Once you understand html and the different types of web requests, POST, GET etc everything should fall into place

  3. #3
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Information about html object library

    Thanks for your advice Kyle! I guess it's time that I get HTML/JS/PHP to know at least a bit.

    but for the time being, can anyone guide me in the right direction as to how to check if javascript has completed its task via VBA? I'm trying to automate an easy but tedious task which involves js. I must find a way to tell vba to move on to the next part only after js has done what it was doing. Anyone got any idea?

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

    Re: Information about html object library

    As far as I know, you can't since javascript will run throughout the page until you navigate away. You could keep checking whether the relevant objects you are wanting to use have beeb added to the dom with the relevant error handling though. just use getelementbyid in a loop until tge relevant object is found.

    You don't really need to learn a backend language like php, just http requests, have a look on w3c schools. ideally you don't wabt to use internet explorer, you want to send requests directly to the server with libraries like msxml

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    If you are automating IE you could try checking out the document's ready state.
    If posting code please use code tags, see here.

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

    Re: Information about html object library

    It doesn't work I'm afraid norie, most javascript uses the ready event of the browser to start as before that the full dom may bot have loaded so the code will fail. Using the same value in vba is therefore unreliable since chances are you'd be running vba concurrently with the JavaScript.

    Its one of tge reasons that it's best to avoid ie altogether for complex web applications (or at all if possible).

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    It's worked for me.

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

    Re: Information about html object library

    It may well do, but it isn't reliable; it depends heavily on the structure of the page and exactly what the javascript is doing and how much of it is actually required for the page to function. But it's all kind of moot since the automation of ie is only really necessary in fringe cases, 99% of web interaction can be performed much more efficiently without automating internet explorer.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    I know that it's not ideal to automate IE but sometimes it's not possible to use other methods.

  10. #10
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Information about html object library

    Thanks for both your inputs Norie and Kyle! I'm using the readystate property at other points of my code but when it comes to js, it's just like Kyle said - IE gives me the info that the site is ready while js still hasn't changed the content.

    Thanks!

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    What is the script actually doing?

    Can you post the URL?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] using html obj library w/ excel - pull a default value from an input tag
    By jayinthe813 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2012, 09:35 PM
  2. Replies: 12
    Last Post: 06-20-2012, 01:53 PM
  3. VB class/object library
    By hojkoff in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-13-2011, 06:00 PM
  4. Object library
    By clairet18 in forum Excel General
    Replies: 3
    Last Post: 10-29-2008, 05:03 AM
  5. [SOLVED] WMI OBJECT LIBRARY
    By RAFAAJ2000 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-03-2006, 06:30 AM

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