I am not able to click on a button that generates a report in Excel (after it opens that "File Download" tab "Do you want to save? Open? Cancel ?, but this part is quiet, I think, if not me and if they already have the solution ...).
Problem is tried several ways:
IE.Document.getElementById("download_token_value").removeAttribute("onClick") 'FAILED
IE.Document.getElementById("download_token_value").setAttribute "onClick", "return true" 'FAILED
IE.Document.getElementsByName("DownloadToken").Item.onclick 'FAILED
For Each Button In IE.Document.getElementsByTagName("DownloadToken") 'FAILED
Button.Click
Next
IE.Document.getElementById("download_token_value").submit 'FAILED
IE.Document.getElementById("download_token_value").Click 'FAILED
IE.Document.all("download_token_value").Click 'FAILED
IE.Document.getElementById("download_token_value").Click 'FAILED
IE.Document.getElementsByName("DownloadToken").Item.Click 'FAILED
None of these worked, and I changed properties several times as I said:
</ul>
</div>
<form action="/RptManifestoStatus/Index" method="post"><input id="download_token_value" name="DownloadToken" type="hidden" value="" />
<div class ="toolbar">
<div class ="toolbarBorder">
<div class="toolbarItem">
<input class="btExportarExcel" src="/Content/images/pix.gif" style="vertical-align: bottom; border:0;" type="image" value="" />
</div>
</div>
</div>
<div class="boxContent">
<div id="tabs">
<ul>
Another observation, all methods, using "Click" work, the code runs, but ... does not open the file download tab, as if it did not click the button, ie it finds the object / button , just does not run the script I think. It is the last step, practically for this macro, the process will be 100% automatic with that.