macro excel for web

Twity
NewLounger
Posts: 1
Joined: 11 May 2013, 19:14

macro excel for web

Post by Twity »

Someone could help me?
I can not activate the item 3 of the table with a macro in excel

Attached programming I've tried to create.


Sub Abrir()

Dim ie As Object

Set ie = CreateObject("InternetExplorer.Application")

ie.navigate "http://www.cipsa.cl"

While ie.Busy
DoEvents
Wend

ie.Document.All.Item("usuario").Value = "Director"
ie.Document.All.Item("password").Value = "pedvirtual"

ie.Document.All.Item("sistema").SelectedIndex = 1

ie.navigate ("javascript:chequear();")

ie.Document.All.Item("menuv").SelectedIndex = 3

' ie.Document.All.Item("menuv").option(3).Click

ie.Visible = True

Set ie = Nothing

End Sub

it Runs up the instruction: ie.navigate ("javascript: chequear();")



The Source code of the website.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<head><title>SISTEMA SAED</title>
<script src="./templates/jquery/jquery.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
function loading() {
document.getElementById('precarga').style.display='none';
document.getElementById('central').style.display='block';
window.addEvent('domready', function() {
SexyLightbox = new SexyLightbox();
});
}

function chequear() {
if(seleccion.carrera.value == '') {
alert(" ATENCIÓN!\n\nDEBE SELECCIONAR UNA CARRERA!");
return false;
} else {
document.forms.seleccion.submit();
return true;
}
}
</script>
<!-- NUEVA FUNCION -->
<script>
function Blink()
{
var ElemsBlink = document.getElementsByTagName('blink');
for(var i=0;i<ElemsBlink.length;i++)
ElemsBlink.style.visibility = ElemsBlink.style.visibility
=='visible' ?'hidden':'visible';
}
</script>
<!-- FIN NUEVA FUNCION -->
<link rel="stylesheet" href="./templates/css/body.css" type="text/css" media="screen">
<link rel="stylesheet" href="./templates/css/menus.css" type="text/css" media="screen">
<link rel="stylesheet" href="./templates/css/frames.css" type="text/css" media="screen">
<!--[if IE 8]>
<link rel="stylesheet" href="./templates/css/IE/8/body.css" type="text/css" media="screen">
<link rel="stylesheet" href="./templates/css/IE/8/menus.css" type="text/css" media="screen">
<link rel="stylesheet" href="./templates/css/IE/8/frames.css" type="text/css" media="screen">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" href="./templates/css/IE/7/body.css" type="text/css" media="screen">
<link rel="stylesheet" href="./templates/css/IE/7/menus.css" type="text/css" media="screen">
<link rel="stylesheet" href="./templates/css/IE/7/frames.css" type="text/css" media="screen">
<![endif]-->
<link rel="stylesheet" href="selector.css" media="screen" type="text/css">
</head>
<body OnLoad="setInterval('Blink()',500); loading();"><div id=\"precarga\"></div><div id=\"central\">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div id="datos1">
<strong>SECCION SUPERVISOR</strong><br />
<strong>NOTIFICACIONES: SIN NOTIFICACIONES</strong>
<div style="position:relative; top:10px;right:0px;font: 120% Arial;"><strong>BIENVENIDO JAIME LOPEZ ALVAREZ</strong></div>
</div>
<div id="datos2">
<strong>FECHA / HORA DE INGRESO: </strong>11/05/2013 16:24:21<br />
<strong>ÚLTIMO ACCESO: </strong> <a href="#LL" style="color: #3366CC;" /> 2013-05-10 a las 23:26:37</a>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td width="15%" valign="top"><table width="100%">
<tr align="left">
<td><div id="menuv"><ul><li><a href="motor.php?categoria=peticion&pet=1d&n=4" target="central">- Ver Acta De Notas</a></li><li><a href="motor.php?categoria=peticion&pet=2d&n=4" target="central">- Ver Tareas</a></li><li><a href="motor.php?categoria=peticion&pet=3d&n=4" target="central">- Certificado Concentración De Notas</a></li><li><a href="motor.php?categoria=peticion&pet=4d&n=4" target="central">- Ver Módulos Y Contenidos</a></li><li><a href="motor.php?categoria=peticion&pet=6d&n=4" target="central">- Datos Personales</a></li><li><a href="motor.php?categoria=peticion&pet=7d&n=4" target="central">- Reporte De Fallas</a></li><li><a href="logout.php" target="">- Salir</a></li></ul></div></tr></td></table></td>
<td width="85%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><iframe scrolling="auto" frameborder="0" id="central" class="fram" name="central" src="main.php" style="width:735px; height:480px; padding-top:-20px; border: 1px solid #ACCFE8;" /></iframe></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>[sistema beta SAED]</td>
</tr>
</table></td>
</tr>
</table></div>
</body>
</html>

User avatar
HansV
Administrator
Posts: 78643
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: macro excel for web

Post by HansV »

Welcome to Eileen's Lounge!

This is beyond my competence, but I don't think you can navigate to a JavaScript function.
And when I visit the web page, there is no mention of "menuv" in its page source.
Best wishes,
Hans