+ Reply to Thread
Results 1 to 3 of 3

Call Javascript in VBA using IE object / update DateDropBox

  1. #1
    Registered User
    Join Date
    09-30-2013
    Location
    New york, NY
    MS-Off Ver
    Excel 2007
    Posts
    5

    Call Javascript in VBA using IE object / update DateDropBox

    I am trying to change the value of the date dropbox on the following website. Whereas my code does change the value, when I click the Show Prices button, the date has not changed. It gets me prices for the dates I chose when I clicked the webpage with the mouse. Could someone please tell me what I am missing?
    Thanks for your help!!


    Webpage
    http://www.tripadvisor.com/Hotel_Rev..._New_York.html

    Html Code:
    HTML Code: 

    My Code:
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 03-04-2014 at 08:25 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Call Javascript in VBA using IE object / update DateDropBox

    Hi shahzeb, try this as a start. I disabled the date dropdown, which I think is the most simple way to do it:

    Please Login or Register  to view this content.
    Cheers,
    berlan
    Last edited by berlan; 03-05-2014 at 04:42 PM.

  3. #3
    Registered User
    Join Date
    09-30-2013
    Location
    New york, NY
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Call Javascript in VBA using IE object / update DateDropBox

    Thanks Berlan.
    That did not do the trick but it did get me thinking along the correct direction.
    Setting the text field to the desired date does not do that trick... i had to invoke the following procedures to store the dates

    .Document.parentWindow.execScript "ta.store('multiDP.checkIn', "03/07/2014");"
    .Document.parentWindow.execScript "ta.store('multiDP.checkOut', "03/08/2014");"

    I guess there is some "lazy" code that loads forms after the whole document loads (depending on my actions on the page)... so I need to invoke other procedures to update the prices for newer dates? Am I thinking along the correct lines?

    And again, thanks for your help. It is much appreciated!

    SZ

+ 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. Use VBA to update a Webpage using JavaScript
    By S_NEGS in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-16-2013, 04:50 AM
  2. Soft coding object call
    By Henri F in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2013, 09:29 PM
  3. [SOLVED] how to call a function, and send across a worksheet object
    By aaronkoh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-27-2012, 04:49 AM
  4. Call function must return variant or object
    By BCITgirl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2010, 03:23 AM
  5. [SOLVED] How can I call a JavaScript Function from Excel VBA
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-17-2006, 10:40 AM

Tags for this Thread

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