Link to home
Start Free TrialLog in
Avatar of patriotpacer
patriotpacer

asked on

VBA - Auto Fill Web Page - Click Image

I'm attempting to auto complete a Web control embedded within an Excel form.  I'm having issues clicking the image button (which submits the form).  Web page code is below.

I think the issue is due to the type being "image."

Name of image on web form: aviaf_selectgroupbutton

Grasping for straws I've tried...
UserForm1.WebBrowser1.Document.forms(0).GetElementById("aviaf_selectgroupbutton").InvokeMember ("click")
UserForm1.WebBrowser1.Document.forms(0).submit
UserForm1.Document.forms(0).elements("aviaf_selectgroupbutton").Click



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>My Data Views (prodrac)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="/WebFramework/styles/default.css" rel="stylesheet" type="text/css" />

</head>
<body bgcolor="#FFFFFF">
<form name="login" action="myDataView.asp" method="post">

<table width="100%" border="0">
<tr>
<td align="center">


<table width="652" border="0" cellspacing="2" cellpadding="0">
<tr> 
	<td valign="bottom" align="center"><img src="images/Banner.gif" alt="" title=" " border="0" /></td>
</tr>
<tr>
	<td class="r0b" align="center" height="30" background="images/bg2.gif">
		<b><font face="Arial" size="2">Please Select a  Data View</font></b>
	</td>
</tr>
<tr>
	<td align="center"  class="r2b">
		<table cellpadding="1" cellspacing="0" border="0">
		<tr>
			<td class="r2b">View:</td>
			<td class="r2b">
					<select name="client_id_user_group_id" style="font-family: arial">
					<option value="1:8">AVI Operations</option>
<option value="1:11">National - Read Only</option>

					</select>
			</td>
		</tr>
		</table>
	</td>
</tr>
<tr>
	<td align="right" background="images/bg2.gif" height="30">
		<input type="image" name="aviaf_selectgroupbutton" alt="SELECT-GROUP" title="Please select a group" src="images/select.gif" 
			onmouseout="this.src='images/select.gif'"  onmouseover="this.src='images/selectb.gif'" />
	</td>
</tr>
</table>
</td>
</tr>
</table>
<input type="hidden" name="app_id" value="3" />
<input type="hidden" name="app_url" value="" />
</form>
</body>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of patriotpacer
patriotpacer

ASKER

Good job, man!  That worked!

I've been banging my head against the wall.

thank you.