
Ayuda a pasar codigo de excell a Código de Access
Publicado por novo34 (1 intervención) el 02/04/2014 17:35:59
Estimados Amigos,
Necesito su ayuda por favor, tengo una macro que me corre excelentemente en excel pero estoy tratando de ponerla en un formulario de access y que realice la misma función pero no me sirve, como puedo cambiar el código para que trabaje en access???
Private Sub Comando63_Click()
Dim winreq As Object
Dim htmldoc As Object
Dim htmlinputs As Object
Dim htmltds As Object
Set winreq = CreateObject("WinHttp.winHttpRequest.5.1")
Set htmldoc = CreateObject("htmlfile")
On Error Resume Next
With winreq
.Open "POST", "MI PAGINA WEB"
.SetCredentials "MICLAVE", "MIUSUARIO", 0
.send "lv_tele=" & Numero
End With
htmldoc.body.innerHTML = winreq.responseText
Set htmlinputs = htmldoc.getElementsByTagName("input")
Num_de_Cedula.Text = htmlinputs(1).Value
TxtISCC.Text = htmlinputs(6).Value
Nombre.Text = htmlinputs(0).Value
Dirección.Text = htmlinputs(4).Value
' ya tenemos el número de cuenta así que podemos seguir con la segunda solicitud.
With winreq
.Open "POST", "MI PAGINA WEB"
.SetCredentials "MICLAVE", "MIUSUARIO", 0
.send "lv_cuenta=" & TxtISCC
End With
htmldoc.body.innerHTML = winreq.responseText
Set htmlinputs = htmldoc.getElementsByTagName("input")
NumeroConvencional.Text = htmlinputs(5).Value
htmldoc.body.innerHTML = winreq.responseText
Set HTMLTable = htmldoc.getElementsByTagName("table")(3)
Set htmltds = HTMLTable.getElementsByTagName("tr")(1).ChildNodes
TextBox6.Text = htmltds(0).innerText
Institución.Text = htmltds(1).innerText
Cuenta.Text = htmltds(2).innerText
Set HTMLTable = Nothing
Set htmltds = Nothing
Set htmldoc = Nothing
Set winreq = Nothing
End Sub
Ayúdenme por favor para poder ejecutar esta macro en access
Necesito su ayuda por favor, tengo una macro que me corre excelentemente en excel pero estoy tratando de ponerla en un formulario de access y que realice la misma función pero no me sirve, como puedo cambiar el código para que trabaje en access???
Private Sub Comando63_Click()
Dim winreq As Object
Dim htmldoc As Object
Dim htmlinputs As Object
Dim htmltds As Object
Set winreq = CreateObject("WinHttp.winHttpRequest.5.1")
Set htmldoc = CreateObject("htmlfile")
On Error Resume Next
With winreq
.Open "POST", "MI PAGINA WEB"
.SetCredentials "MICLAVE", "MIUSUARIO", 0
.send "lv_tele=" & Numero
End With
htmldoc.body.innerHTML = winreq.responseText
Set htmlinputs = htmldoc.getElementsByTagName("input")
Num_de_Cedula.Text = htmlinputs(1).Value
TxtISCC.Text = htmlinputs(6).Value
Nombre.Text = htmlinputs(0).Value
Dirección.Text = htmlinputs(4).Value
' ya tenemos el número de cuenta así que podemos seguir con la segunda solicitud.
With winreq
.Open "POST", "MI PAGINA WEB"
.SetCredentials "MICLAVE", "MIUSUARIO", 0
.send "lv_cuenta=" & TxtISCC
End With
htmldoc.body.innerHTML = winreq.responseText
Set htmlinputs = htmldoc.getElementsByTagName("input")
NumeroConvencional.Text = htmlinputs(5).Value
htmldoc.body.innerHTML = winreq.responseText
Set HTMLTable = htmldoc.getElementsByTagName("table")(3)
Set htmltds = HTMLTable.getElementsByTagName("tr")(1).ChildNodes
TextBox6.Text = htmltds(0).innerText
Institución.Text = htmltds(1).innerText
Cuenta.Text = htmltds(2).innerText
Set HTMLTable = Nothing
Set htmltds = Nothing
Set htmldoc = Nothing
Set winreq = Nothing
End Sub
Ayúdenme por favor para poder ejecutar esta macro en access
Valora esta pregunta


0