?
Solved

VBA - Auto Fill Web Page - Click Image

Posted on 2013-11-29
2
Medium Priority
?
1,373 Views
Last Modified: 2013-11-29
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

0
Comment
Question by:patriotpacer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

Accepted Solution

by:
Norie earned 2000 total points
ID: 39685630
How has the code you've tried failed?

Does this work?
Dim frm As Object

    Set frm = UserForm1.WebBrowser1.Document.forms(0)

    frm.submit

Open in new window

0
 

Author Closing Comment

by:patriotpacer
ID: 39685683
Good job, man!  That worked!

I've been banging my head against the wall.

thank you.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

770 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