PDA

View Full Version : #Click in Botton of Web Site whith VBA Excel 2007



magushi
09-22-2014, 12:19 PM
Dear, good afternoon!
Can you help me?
Must click a button on a website, but can not.
Below is the source code of the page:

'<TD class=clsCampo2 align=left><SPAN id=DetalhesProposta1_lblPropostaD>Proposta Mapfre</SPAN>: </TD>
<TD style="WIDTH: 300px" align=left><SPAN id=DetalhesProposta1_lblPropostaDValue>10407846860628243</SPAN>&nbsp; <INPUT style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" id=DetalhesProposta1_lnkbtnDocumentoEletronico onclick="window.open('/EntradaPropostas/ImprimirProposta.aspx?NumeroNSU=10407846860628243','', 'resizable=no, menubar=no,scrollbars=yes,width=100,height=100');" src="../Imagens/print.gif" type=image name=DetalhesProposta1$lnkbtnDocumentoEletronico> </TD>
<TD style="BACKGROUND-COLOR: #eee" colSpan=2 align=middle><SPAN id=DetalhesProposta1_lblPropostaConciliadaD>Proposta Conciliada com TronWeb</SPAN>: </TD></TR><TD class=clsCampo2 align=left><SPAN id=DetalhesProposta1_lblPropostaD>Proposta Mapfre</SPAN>: </TD>
<TD style="WIDTH: 300px" align=left><SPAN id=DetalhesProposta1_lblPropostaDValue>10407846860628243</SPAN>&nbsp; <INPUT style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" id=DetalhesProposta1_lnkbtnDocumentoEletronico onclick="window.open('/EntradaPropostas/ImprimirProposta.aspx?NumeroNSU=10407846860628243','', 'resizable=no, menubar=no,scrollbars=yes,width=100,height=100');" src="../Imagens/print.gif" type=image name=DetalhesProposta1$lnkbtnDocumentoEletronico> </TD>
<TD style="BACKGROUND-COLOR: #eee" colSpan=2 align=middle><SPAN id=DetalhesProposta1_lblPropostaConciliadaD>Proposta Conciliada com TronWeb</SPAN>: </TD></TR>'

I am use below macro code:

.document.getelementByID("DetalhesProposta1_lnkbtnDocumentoEletronico").click

But dont funcion

Can help me?

westconn1
09-22-2014, 02:30 PM
possibly you would need to fire the onclick event, which may not happen, clicking the button by code

magushi
09-22-2014, 05:45 PM
possibly you would need to fire the onclick event, which may not happen, clicking the button by code



You cant help me?

what code to click in button?

westconn1
09-23-2014, 02:08 AM
as i can not test, you can try

.document.getelementByID("DetalhesProposta1_lnkbtnDocumentoEletronico").fireevent "onlick"

magushi
09-23-2014, 04:07 AM
as i can not test, you can try

.document.getelementByID("DetalhesProposta1_lnkbtnDocumentoEletronico").fireevent "onclick"

My friend, dont function.
Error 91.

You Cant help me?

Thanks.

westconn1
09-23-2014, 05:54 AM
i am not surprised it does not work when you only post a small part of the problem
you did not say in your original post in this forum that you were getting an error of any type

this thread is x posted at http://www.vbforums.com/showthread.php?776689-How-Clicking-the-button-with-Id-and-Name
and possibly others