Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Enter Data on HTML or ASP Web Page from VB

Posted on 2003-03-18
Medium Priority
Last Modified: 2010-04-07
Is there any way of getting a handle or ??? of say a tick box on a web page, from a vb executable program.
Ie. I need to enter several tick boxes on a web page from my vb program.
I know how to get the handle of another program running but not a web page.
Question by:kennedymr
  • 2
  • 2
LVL 28

Expert Comment

ID: 8162327
You won't use a window handle to send messages to items on a webpage as they are not windows controls, they are html elements.  If you are talking about an open instance of Internet Explorer, then you have access to the DOM (Document Object Model) of the html page currently loaded inside of it, and you can manipulate it with code that would appear very similar to a scripted implementation (javascript or vbscript).  If you are talking about any browser, such as Netscape or Opera, you may be stuck using some ugly workarounds (unless they provide some sort of techniques in their respective SDKs).

Author Comment

ID: 8162575
I would be using Inernet Explorer.
Sounds pretty complicated!!!!
May have to give this idea a miss.
LVL 28

Accepted Solution

AzraSound earned 500 total points
ID: 8163950
Example, set a reference to Microsoft Internet Controls

Dim shWin As New ShellWindows
Dim IE As InternetExplorer

For Each IE In shWin
    If IE.LocationURL = "http://www.site.com" Then
        'you now know the instance of IE to target and set values for
        IE.Document.all("chkBox").checked = True
    End If

Where the html may look like:

<input type="checkbox" name="chkBox">

Author Comment

ID: 8164271
Appreciate your help.
I can see the method, and will give it a go. Thanks

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question