+ Reply to Thread
Results 1 to 9 of 9

Click gif image in IE via VBA

  1. #1
    Forum Contributor
    Join Date
    12-19-2011
    Location
    Central Europe
    MS-Off Ver
    Excel O365
    Posts
    361

    Click gif image in IE via VBA

    Hi everyone


    Please Login or Register  to view this content.


    The values are used as filter criteria and are applied by clicking a gif image with following details

    HTML Code: 

    How exactly can I get the .click command to apply to this button?

    Thanks
    FD

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

    Re: Click gif image in IE via VBA

    The click event of the image appears to submit a form, so perhaps you could try submitting the form.
    Please Login or Register  to view this content.
    If that doesn't work then you'll need to get a reference to the image element and then fire it's click event.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    12-19-2011
    Location
    Central Europe
    MS-Off Ver
    Excel O365
    Posts
    361

    Re: Click gif image in IE via VBA

    Hi Norie

    I've tried that actually - does not work unfortunately

    How would I identify the reference to the image in this case?
    Is there anything I can do with the source location

    HTML Code: 
    or the "onlick"

    HTML Code: 
    Thanks
    FD

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

    Re: Click gif image in IE via VBA

    Is the image contained in some other element that has something to identify it, eg id/name?

  5. #5
    Forum Contributor
    Join Date
    12-19-2011
    Location
    Central Europe
    MS-Off Ver
    Excel O365
    Posts
    361

    Re: Click gif image in IE via VBA

    The only other thing we have is

    HTML Code: 

  6. #6
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Click gif image in IE via VBA

    Hi, im not in front of my usual pc so cant get to all my info on this subject.
    But try something like this

    Please Login or Register  to view this content.
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  7. #7
    Forum Contributor
    Join Date
    12-19-2011
    Location
    Central Europe
    MS-Off Ver
    Excel O365
    Posts
    361

    Re: Click gif image in IE via VBA

    @Sean

    Thanks that worked great

    For my future reference, could you please explain the ("input") section in this code line?

    Please Login or Register  to view this content.
    Does it refer to

    HTML Code: 
    ?

    Thanks again for your help!
    FD

  8. #8
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Click gif image in IE via VBA

    HTML Code: 
    As you can see the html code is made up from different attributes ie. input, type, src, onclick, title etc depending on how the html code has been written.

    first off after getting the internet explorer html code IE.Document
    we are first off looping through all lines of the html code and creating a collection of all the lines starting with "input"
    Please Login or Register  to view this content.
    then loop through that collection and find the one that has a title called "Search"
    Please Login or Register  to view this content.
    then we use the click function as this code has an onclick action

  9. #9
    Forum Contributor
    Join Date
    12-19-2011
    Location
    Central Europe
    MS-Off Ver
    Excel O365
    Posts
    361

    Re: Click gif image in IE via VBA

    Thanks Sean, much appreciated.

+ 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. Click in Image with iframe
    By magushi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-12-2014, 11:08 AM
  2. Create a 'click map' on an image
    By Bleekscheetje in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2013, 03:18 PM
  3. [SOLVED] click on image change value in cell
    By arctushar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-16-2013, 01:52 PM
  4. on click of an image excel
    By Ranjani in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-12-2009, 05:44 PM
  5. Image Invisible. Click
    By shapper in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2008, 04:15 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