Results 1 to 3 of 3

Call Javascript in VBA using IE object / update DateDropBox

Threaded View

  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:
                    Set objElement = objIE_TA.document.getElementsByTagName("SPAN")
                    For Each input_element In objElement
                        If input_element.ID = "date_picker_in_1028569" Then
                            input_element.Focus
                            input_element.Click
                            input_element.innerText = "03/05/2014"
                            Exit For
                        End If
                    Next input_element
    
    Or
    
    
    Call objIE_TA.document.parentWindow.execScript("ta.call('ta.overlays.Factory.loadDatePicker', event, this, '1028569', false,             ta.widgets.calendar.handleNewDates , {'calendarOptions' : {'parentContainer' : 'HotelDateSearch', 'fontSize' : '1em'}} )", "JavaScript")
    Last edited by Leith Ross; 03-04-2014 at 08:25 PM. Reason: Added Code Tags

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. 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