+ Reply to Thread
Results 1 to 7 of 7

Using Excel VB to control Internet

  1. #1
    Registered User
    Join Date
    10-19-2006
    Posts
    29

    Using Excel VB to control Internet

    Hi

    Does anyone know of a way that VB can be used to explore the internet. For example using VB to open Google and search for "Excel Help".

    I've noticed the term Internet Transfer Control floating around but can't seem to find anything of much use.

    If anyone has any suggestions I would be much appreciated.

    Cheers
    Crispie38

  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
    Hello Crispie38,

    This macro will launch IE and open Google, and searches for "Excel Help". You can change the search in the code marked in blue. However, the code is specific to the Google search page, and will only run with Google. You must first set a reference in Visual Basic to Microsoft Internet Controls for this code to run.
    1. Open your workbook and then press ALT+F11 to open the VBE.
    2. Press ALT+T followed by the Enter key.
    3. Scroll down the list until you find Microsoft Internet Controls.
    4. Press the Space bar to select it, and press Enter
    Please Login or Register  to view this content.
    Adding the Macro
    1. Copy the macro above pressing the keys CTRL+C
    2. Open your workbook
    3. Right Click on any Sheet's tab
    4. Left Click on View Code in the pop up menu
    5. Press the keys ALT+I to activate the Insert menu
    6. Press M to insert a Standard Module
    7. Paste the code by pressing the keys CTRL+V
    8. Make any custom changes you need to the macro
    9. Save the Macro by pressing the keys CTRL+S

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    10-19-2006
    Posts
    29
    Hi Lieth Ross

    That's fantastic, one small problem though, the last piece of your coding you switch from IEapp to just IE, I changed the first instance and it works fine however in the second instance it does not like IEap or IEdoc, could you let me know what I need to do to change this.

    Please Login or Register  to view this content.
    Thanks
    Crispie38

  4. #4
    Registered User
    Join Date
    10-19-2006
    Posts
    29
    Also, is it easy to change the code for other websites? How do you find out that the search button is "btnG" or the search box is "q"??

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

    My apologies for the typos. To change the code you need to use another browser supports viewing the document source page. To pick out the relevant parts in the code, you need to understand HTML.

    Here is the HTML code from Google's page...
    Please Login or Register  to view this content.
    Here is the correct code
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  6. #6
    Registered User
    Join Date
    03-23-2009
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Using Excel VB to control Internet

    I want to click on a link in the google page like iGoogle, Maps or something else using VBA,
    Please some one help me on this.

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

    Re: Using Excel VB to control Internet

    rjndra
    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Hope that helps.

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

    Free DataBaseForm example

+ 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