+ Reply to Thread
Results 1 to 11 of 11

Internet Explorer form automation from Excel

  1. #1
    Forum Contributor
    Join Date
    01-18-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    127

    Internet Explorer form automation from Excel

    Hi all,

    Before going into detail, my question really is whether this can be achieved at all. Looking at previous posts it seems like it could be but I wouldn't know where to start. I'd like to do the following:

    1. Use an already open IE page (this bypasses any code which specifies a particular webpage - the webpage is there and the user is already logged in).
    2. On the online form on the current page, out of all the textboxes, put a value in textbox A.
    3. Find the 'Start' button and click it automatically
    4. When the next page loads, the value will be listed with a name, the name is a hyperlink title text leading into details of the value given. This is usually clicked on but can be accessed by pressing tab 37 times then enter.
    5. On the next page the hyperlink text 'change' needs to be clicked on.
    6. On the next page, all the text needs to be scanned to find a string of characters beginning with '2000'. These first characters constitute a 7 digit value which must be extracted and pasted into the active Excel sheet.
    7. A return to the start is then required by 'clicking' on the text 'Example ABC' available from the left hand menu.

    Is this possible? Please note that it seems the source code is in Javascript.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Internet Explorer form automation from Excel

    You need the names of the web controls
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    01-18-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Internet Explorer form automation from Excel

    Thanks Roy. How would I find these?

    Let's take an example. If the source code is something like:

    Please Login or Register  to view this content.
    How would I get Excel to click this button?

  4. #4
    Forum Contributor
    Join Date
    01-18-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Internet Explorer form automation from Excel

    Does anyone know how to automate IE from Excel to click on the button enabled from the code above?

  5. #5
    Forum Contributor
    Join Date
    07-13-2007
    Posts
    151

    Re: Internet Explorer form automation from Excel

    Try something like this. Fill in your webpage's URL to navigate to that page.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    01-18-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Internet Explorer form automation from Excel

    Hi Shredude, sorry I was away for a bit but have now been able to test your code.

    It does work and pushes that start button the way I want it to.

    Now I need some text to be entered into a text box just before this button is clicked.

    The code for the textbox is:

    Please Login or Register  to view this content.
    So I need something that will select the name here and enter a small number.

    The start button is then clicked (code supplied).

    Then I need some code to start when the next page is loaded after the button is pressed. This final code needs to search the text on the webpage for text beginning with '3000' for example and assign a variable to the whole number, which could be 300023 for example.

    Could you help with that?

  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Internet Explorer form automation from Excel

    Why don't you use a queryTable ?



  8. #8
    Forum Contributor
    Join Date
    01-18-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Internet Explorer form automation from Excel

    Oh Lordy, how would that work? I've not used one before.

  9. #9
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Internet Explorer form automation from Excel

    F1 for all your new experiences.

  10. #10
    Forum Contributor
    Join Date
    07-13-2007
    Posts
    151

    Re: Internet Explorer form automation from Excel

    To enter text in the field on your webpage use something like this:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    01-18-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Internet Explorer form automation from Excel

    Thanks so much ShredDude for your help so far.

    Sorry I was unclear about the other bit - basically the final two elements to this are:

    1. On the next page I need a hyperlink clicked. The hyperlink is the name of an item which then proceeds to refresh the screen with item details. The code is:

    Please Login or Register  to view this content.
    So... how do I get that link clicked to progress to next screen?

    Then there's the text search I was unclear describing. I need is to have the final loaded webpage searched (bit like Ctrl F to find a word on the webpage). It needs to look for a value on the webpage beginning with four unique digits because this will guide it to the whole value i need extracting and put into the Excel workbook. So for example I need it to look for '3000' - which the value will always begin with, and when it finds that on the webpage it needs to extract the whole value - '30004563'. This will then be used in the active Excel worksheet.

    Any way this can be achieved?

+ 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