PDA

View Full Version : VBA code to close html confirm window.



Dev21_n
12-07-2011, 04:28 AM
I have some VBA code that opens a webpage, then calls a javascript function that deletes a member from the page. When this function is called, it calls a confirm window in the HTML to make sure that the user really wants to delete. The options are yes and cancel. My question- Is there any way to automatically make my VBA code answer yes? As it is, I can automate everything but the "yes" click, which means I still have to sit there and click yes for every page that it wants to delete.here is the HTML code.


Function RemoveUserValidation()
{
var table = document.getElementById('ctl00_ContentPageHolder_tabAccTeam_TbPnlAccountTea mSetup_gvAccountTeam')
if(table!=null)
{
var status = false;
for(var rowcount = 1; rowcount< table.rows.length;rowcount++)
{
var row = table.rows[rowcount];
if(row.cells[row.cells.length-1].childNodes[0].checked)
{
status = true;
break;
}
else
{
status = false;
}
}
if(status==true)
{
if(confirm('You have chosen to remove one or more Team members. Are you sure you wish to remove these members?')== true)
{
return true;
}
else
{
return false;
}
}
}
}