Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Button with no name IE automation

Hello

I cannot find the answer to this question anywhere. Please help.

I am using IE automation in Excel to grab information from different sites.
For the first time I have come across a website that uses buttons without
naming them. I have an example code below. I would like to automate clicking
the View Forms button. There seems to be no information to grab in order to
isolate the button and click on it

Anyone got any ideas?

Thanks
David

<html
<head

....

function SubmitForm() {
if (CSValidation()) {
pop('?lang=en'); document.GEOptions.submit();
}
}
function ResetForm() {
pop('?lang=en'); document.GEOptions.submit();
}
function HiliteControlContents() {
// alert(event.srcElement.type);
event.srcElement.select();
}
//--
</script
<script language='JavaScript' type='text/javascript'<!--
function CSValidation() {
var bRv = true;

return bRv;
}
//--</script


</head
<body onload="unpop();"
<div id="container"
<div id="header"
<img id="logo_en" src="images\header.jpg"
</div

<div id="content"

<form name="GEOptions" method="post"
action="GEOptions.aspx?lang=en&st=sl&sesid=" id="GEOptions"

<input type="hidden" name="__VIEWSTATE"
value="dDwxMjAzMTM2NjU1Ozs+LAMHbXDQNveW/O6OLl+hxQiw32M=" /

<span id="XMLSessionMgr"</span

<input type='hidden' id='SesID' name='SesID' value='' /<input type='hidden'
id='DebugID' name='DebugID' value='21' /
<input type=hidden id="button" name="button"

<table
<tr
<td colspan="2" align="left"
<h1Options Menu</h1
</td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a href="javascript:document.GEOptions.button.value=' newform';SubmitForm();"
<div class="ButtonText"New Form</div
</a
</div
</div
</td
<td <h2Create a new Form</h2 </td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a
href="javascript:document.GEOptions.button.value=' editform';SubmitForm();"
<div class="ButtonText"Edit Form</div
</a
</div
</div
</td
<td
<h2Edit an existing form in user tools</h2
</td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a
href="javascript:document.GEOptions.button.value=' viewforms';SubmitForm();"
<div class="ButtonText"View Forms</div
</a
</div
</div
</td
<td
<h2View all forms in spreadsheet view</h2
</td
</tr

</body
</html
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Button with no name IE automation

Use the tag "A". The 3 buttons are found under the ag A and you should be
able to use index to A. I don't program in scripting but in VBA macro code I
would do something like this

Set Buttons = IE.document.getelementsbytagname("A")

Then you will have an array starting a index zero for each object

button(0)
button(1)
button(2)



"David" wrote:

Hello

I cannot find the answer to this question anywhere. Please help.

I am using IE automation in Excel to grab information from different sites.
For the first time I have come across a website that uses buttons without
naming them. I have an example code below. I would like to automate clicking
the View Forms button. There seems to be no information to grab in order to
isolate the button and click on it

Anyone got any ideas?

Thanks
David

<html
<head

...

function SubmitForm() {
if (CSValidation()) {
pop('?lang=en'); document.GEOptions.submit();
}
}
function ResetForm() {
pop('?lang=en'); document.GEOptions.submit();
}
function HiliteControlContents() {
// alert(event.srcElement.type);
event.srcElement.select();
}
//--
</script
<script language='JavaScript' type='text/javascript'<!--
function CSValidation() {
var bRv = true;

return bRv;
}
//--</script


</head
<body onload="unpop();"
<div id="container"
<div id="header"
<img id="logo_en" src="images\header.jpg"
</div

<div id="content"

<form name="GEOptions" method="post"
action="GEOptions.aspx?lang=en&st=sl&sesid=" id="GEOptions"

<input type="hidden" name="__VIEWSTATE"
value="dDwxMjAzMTM2NjU1Ozs+LAMHbXDQNveW/O6OLl+hxQiw32M=" /

<span id="XMLSessionMgr"</span

<input type='hidden' id='SesID' name='SesID' value='' /<input type='hidden'
id='DebugID' name='DebugID' value='21' /
<input type=hidden id="button" name="button"

<table
<tr
<td colspan="2" align="left"
<h1Options Menu</h1
</td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a href="javascript:document.GEOptions.button.value=' newform';SubmitForm();"
<div class="ButtonText"New Form</div
</a
</div
</div
</td
<td <h2Create a new Form</h2 </td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a
href="javascript:document.GEOptions.button.value=' editform';SubmitForm();"
<div class="ButtonText"Edit Form</div
</a
</div
</div
</td
<td
<h2Edit an existing form in user tools</h2
</td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a
href="javascript:document.GEOptions.button.value=' viewforms';SubmitForm();"
<div class="ButtonText"View Forms</div
</a
</div
</div
</td
<td
<h2View all forms in spreadsheet view</h2
</td
</tr

</body
</html

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Button with no name IE automation



"Joel" wrote:

Use the tag "A". The 3 buttons are found under the ag A and you should be
able to use index to A. I don't program in scripting but in VBA macro code I
would do something like this

Set Buttons = IE.document.getelementsbytagname("A")

Then you will have an array starting a index zero for each object

button(0)
button(1)
button(2)



"David" wrote:

Hello

I cannot find the answer to this question anywhere. Please help.

I am using IE automation in Excel to grab information from different sites.
For the first time I have come across a website that uses buttons without
naming them. I have an example code below. I would like to automate clicking
the View Forms button. There seems to be no information to grab in order to
isolate the button and click on it

Anyone got any ideas?

Thanks
David

<html
<head

...

function SubmitForm() {
if (CSValidation()) {
pop('?lang=en'); document.GEOptions.submit();
}
}
function ResetForm() {
pop('?lang=en'); document.GEOptions.submit();
}
function HiliteControlContents() {
// alert(event.srcElement.type);
event.srcElement.select();
}
//--
</script
<script language='JavaScript' type='text/javascript'<!--
function CSValidation() {
var bRv = true;

return bRv;
}
//--</script


</head
<body onload="unpop();"
<div id="container"
<div id="header"
<img id="logo_en" src="images\header.jpg"
</div

<div id="content"

<form name="GEOptions" method="post"
action="GEOptions.aspx?lang=en&st=sl&sesid=" id="GEOptions"

<input type="hidden" name="__VIEWSTATE"
value="dDwxMjAzMTM2NjU1Ozs+LAMHbXDQNveW/O6OLl+hxQiw32M=" /

<span id="XMLSessionMgr"</span

<input type='hidden' id='SesID' name='SesID' value='' /<input type='hidden'
id='DebugID' name='DebugID' value='21' /
<input type=hidden id="button" name="button"

<table
<tr
<td colspan="2" align="left"
<h1Options Menu</h1
</td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a href="javascript:document.GEOptions.button.value=' newform';SubmitForm();"
<div class="ButtonText"New Form</div
</a
</div
</div
</td
<td <h2Create a new Form</h2 </td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a
href="javascript:document.GEOptions.button.value=' editform';SubmitForm();"
<div class="ButtonText"Edit Form</div
</a
</div
</div
</td
<td
<h2Edit an existing form in user tools</h2
</td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a
href="javascript:document.GEOptions.button.value=' viewforms';SubmitForm();"
<div class="ButtonText"View Forms</div
</a
</div
</div
</td
<td
<h2View all forms in spreadsheet view</h2
</td
</tr

</body
</html

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Button with no name IE automation

Perfect!
That array works well. I will work on maybe trying to check the button text
before I click for error checking but for now I can click things at least.

Thanks

"Joel" wrote:

Use the tag "A". The 3 buttons are found under the ag A and you should be
able to use index to A. I don't program in scripting but in VBA macro code I
would do something like this

Set Buttons = IE.document.getelementsbytagname("A")

Then you will have an array starting a index zero for each object

button(0)
button(1)
button(2)



"David" wrote:

Hello

I cannot find the answer to this question anywhere. Please help.

I am using IE automation in Excel to grab information from different sites.
For the first time I have come across a website that uses buttons without
naming them. I have an example code below. I would like to automate clicking
the View Forms button. There seems to be no information to grab in order to
isolate the button and click on it

Anyone got any ideas?

Thanks
David

<html
<head

...

function SubmitForm() {
if (CSValidation()) {
pop('?lang=en'); document.GEOptions.submit();
}
}
function ResetForm() {
pop('?lang=en'); document.GEOptions.submit();
}
function HiliteControlContents() {
// alert(event.srcElement.type);
event.srcElement.select();
}
//--
</script
<script language='JavaScript' type='text/javascript'<!--
function CSValidation() {
var bRv = true;

return bRv;
}
//--</script


</head
<body onload="unpop();"
<div id="container"
<div id="header"
<img id="logo_en" src="images\header.jpg"
</div

<div id="content"

<form name="GEOptions" method="post"
action="GEOptions.aspx?lang=en&st=sl&sesid=" id="GEOptions"

<input type="hidden" name="__VIEWSTATE"
value="dDwxMjAzMTM2NjU1Ozs+LAMHbXDQNveW/O6OLl+hxQiw32M=" /

<span id="XMLSessionMgr"</span

<input type='hidden' id='SesID' name='SesID' value='' /<input type='hidden'
id='DebugID' name='DebugID' value='21' /
<input type=hidden id="button" name="button"

<table
<tr
<td colspan="2" align="left"
<h1Options Menu</h1
</td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a href="javascript:document.GEOptions.button.value=' newform';SubmitForm();"
<div class="ButtonText"New Form</div
</a
</div
</div
</td
<td <h2Create a new Form</h2 </td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a
href="javascript:document.GEOptions.button.value=' editform';SubmitForm();"
<div class="ButtonText"Edit Form</div
</a
</div
</div
</td
<td
<h2Edit an existing form in user tools</h2
</td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a
href="javascript:document.GEOptions.button.value=' viewforms';SubmitForm();"
<div class="ButtonText"View Forms</div
</a
</div
</div
</td
<td
<h2View all forms in spreadsheet view</h2
</td
</tr

</body
</html

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Button with no name IE automation

Why not try submitting the form?

forms(0).Submit

You might have to change some value on the page to make sure the correct
action is taken when the form is submitted.

"David" wrote:

Hello

I cannot find the answer to this question anywhere. Please help.

I am using IE automation in Excel to grab information from different sites.
For the first time I have come across a website that uses buttons without
naming them. I have an example code below. I would like to automate clicking
the View Forms button. There seems to be no information to grab in order to
isolate the button and click on it

Anyone got any ideas?

Thanks
David

<html
<head

...

function SubmitForm() {
if (CSValidation()) {
pop('?lang=en'); document.GEOptions.submit();
}
}
function ResetForm() {
pop('?lang=en'); document.GEOptions.submit();
}
function HiliteControlContents() {
// alert(event.srcElement.type);
event.srcElement.select();
}
//--
</script
<script language='JavaScript' type='text/javascript'<!--
function CSValidation() {
var bRv = true;

return bRv;
}
//--</script


</head
<body onload="unpop();"
<div id="container"
<div id="header"
<img id="logo_en" src="images\header.jpg"
</div

<div id="content"

<form name="GEOptions" method="post"
action="GEOptions.aspx?lang=en&st=sl&sesid=" id="GEOptions"

<input type="hidden" name="__VIEWSTATE"
value="dDwxMjAzMTM2NjU1Ozs+LAMHbXDQNveW/O6OLl+hxQiw32M=" /

<span id="XMLSessionMgr"</span

<input type='hidden' id='SesID' name='SesID' value='' /<input type='hidden'
id='DebugID' name='DebugID' value='21' /
<input type=hidden id="button" name="button"

<table
<tr
<td colspan="2" align="left"
<h1Options Menu</h1
</td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a href="javascript:document.GEOptions.button.value=' newform';SubmitForm();"
<div class="ButtonText"New Form</div
</a
</div
</div
</td
<td <h2Create a new Form</h2 </td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a
href="javascript:document.GEOptions.button.value=' editform';SubmitForm();"
<div class="ButtonText"Edit Form</div
</a
</div
</div
</td
<td
<h2Edit an existing form in user tools</h2
</td
</tr

<tr
<td
<div class="ButtonBox"
<div class="Button"
<a
href="javascript:document.GEOptions.button.value=' viewforms';SubmitForm();"
<div class="ButtonText"View Forms</div
</a
</div
</div
</td
<td
<h2View all forms in spreadsheet view</h2
</td
</tr

</body
</html



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop running macro button, like Ctrl-Break button Dave Peterson Excel Programming 1 January 22nd 09 05:23 PM
Stop running macro button, like Ctrl-Break button Ronald R. Dodge, Jr.[_2_] Excel Programming 0 January 22nd 09 04:59 PM
Supressing the ctrl-c and other keys during word automation in automation apondu Excel Programming 0 July 19th 07 10:10 PM
Automation Error when deleting command bar button Frank Kabel Excel Programming 6 August 4th 04 04:09 PM
Delete a custom button by holding down the ALT key and dragging the button off the toolbar Stephen[_8_] Excel Programming 0 April 4th 04 02:22 PM


All times are GMT +1. The time now is 07:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"