Consulting

Results 1 to 3 of 3

Thread: Simulating mouse click on web page

  1. #1

    Exclamation Simulating mouse click on web page

    Im trying to automate a webpage which has a table built with some grid. The user has to click on the a cell in the table to display another table in the right side of the page. I can access the cells in the table but i couldnt fire the click event on the cells. I already made a thread on this but nobody replied except one. Since firing the mouse click event didnt work i thought of setting focus on that cell and generating a mouse click. Does anyone have any idea how to do this? I searched in other forums but it seems theres no way to generate a mouse click unless i use API??? I dont know much about this API. Any suggestion will be helpful

  2. #2
    If by 'API' you mean the HTML Object Library, then something like this sets the focus on a cell and clicks it (obviously you'll have to change the Set cell line so that it references the correct cell element):
    Sub xx()
        Dim cell As HTMLTableCell
        Set cell = ie.document....the cell
        cell.Focus
        cell.Click
    End Sub
    But why start a new thread on the same problem? Keep everything in one thread and then people can easily see how far you've got and what you've tried.

    In your other thread - h ttp://w ww.vbaexpress.com/forum/showthread.php?t=31798 - post the complete HTML source, not just a snippet, plus the Javascript source code of any included .js files

  3. #3
    I tried the method you said but it still doesnt work.. I tried firing onclick,onmouseup,ondblclick events on the cell but no luck. And one more thing.. There are checkboxes in every cell. Does this mean this is a different kind of table which cant be accessed? I can access the innertext in that cell but only this clicking thing doesnt work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •