+ Reply to Thread
Results 1 to 2 of 2

Using VBA to Select Dropdown Item

  1. #1
    Registered User
    Join Date
    06-21-2013
    Location
    Dallas
    MS-Off Ver
    Excel 2003
    Posts
    1

    Using VBA to Select Dropdown Item

    Howdy all!

    Well, I've been able to do some pretty awesome things with VBA (self taught...well, Google taught anyway), but I might have just come across something it can't do. I hope I am wrong, though.

    I use an Excel spreadsheet to populate some web forms for work, and it usually works really well. I have gotten to know the Locals window fairly good in the VB editor. I can usually populate a field with a someobjname.Item(xx).Value = blahblah type of code. But now I have hit a snag. I have a new form I am filling out that I think uses Jquery which I know nothing about. There is a dropdown menu that when you select an item, it triggers a function that changes some stuff on the screen....problem is, I can't find the function anywhere in the source code of the web page. I can manually populate the textbox with what I want, but that doesn't trigger the function.

    My limited understanding of Jquery is that there is some separate file that contains a library of functions that can be called by a web page. Is there some way I can find out the name of that file, copy the function into my code and have VBA execute the function? Is it possible to trigger it within its own library? I don't really want to have to learn everything about Jquery right now to get this one thing done.

    I may just have to stop the code in a few places to manually select these dropdowns, and then continue the code to populate the other fields that don't have it.

    Just kind of fishing for information right now. I'm not really even sure exactly what question to ask.

    Thanks,
    Ric

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Using VBA to Select Dropdown Item

    Hello Ric_W,

    Without seeing what you have written nor the page source of the web page, it is difficult to accurately answer your question.

    On a web page, a drop down is a Select object. Each Select object contains Option objects that are selected.

    The SelectedIndex property of the Select object returns or sets an Option. You can return the collection of Option objects by using the Select object property Options.

    Once you have selected an option, you use the Click method to send your choice to the server.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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