Excel to Web Automation

plasma33

New member
Local time
Today, 11:37
Joined
May 13, 2012
Messages
2
Hi Guys,

Here is what I am trying to do via Macro Automation->

-> I am trying to open a website given in the code

-> Then clicking on the "click here to start"

-> Then checking the radio button for "Peak intensity table"

-> Then click on "Browse" the data file and select a file manually.

-> Then finally click on the submit button (which is not working and path to the file vanishes while clicking on the submit button and giving me an Automation error ['-2147352319 (80020101)'])


Here is the code that works fine except for the last step which is submitting->
Code:
Sub MetaboAnn()

Dim IE As Object

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

IE.Navigate "Can't post the link coz don't have 10 or more posts"
Do Until IE.ReadyState = 4
DoEvents
Loop
                
Application.Wait (Now + TimeValue("0:00:05"))
'MsgBox "Done"
IE.Visible = True
        
IE.Document.getElementById("form1:groupPanel1:loginLink").Click

Application.Wait (Now + TimeValue("0:00:05"))
'MsgBox "Done"
IE.Visible = True

IE.Document.getElementById("form1:tabSet1:tab1:layoutPanel7:csvButtonGroup:csvButtonGroup_2_rb").Click

Application.Wait (Now + TimeValue("0:00:03"))
'MsgBox "Done"
IE.Visible = True

IE.Document.all("form1:tabSet1:tab1:layoutPanel7:statCsvUpload_com.sun.webui.jsf.upload").Click

Application.Wait (Now + TimeValue("0:00:03"))
'MsgBox "Done"
IE.Visible = True

IE.Document.getElementById("form1:tabSet1:tab1:layoutPanel7:csvSubmitButton").Click

End Sub

html code->
Code:
<td><span id="form1:tabSet1:tab1:layoutPanel7:statCsvUpload"><input type="file" size="36" id="form1:tabSet1:tab1:layoutPanel7:statCsvUpload_com.sun.webui.jsf.upload" name="form1:tabSet1:tab1:layoutPanel7:statCsvUpload_com.sun.webui.jsf.upload" class="TxtFld_sun4" />
</span><script type="text/javascript">webui.suntheme4_2.dojo.addOnLoad(function() {webui.suntheme4_2.upload.setEncodingType('form1:tabSet1:tab1:layoutPanel7:statCsvUpload');
});</script></td>
</tr>
</tbody>
</table>
</td>
<td><span id="_form1:tabSet1:tab1:layoutPanel7:csvSubmitButton"><script type="text/javascript">webui.suntheme4_2.widget.common._createWidget('_form1:tabSet1:tab1:layoutPanel7:csvSubmitButton',{"id":"form1:tabSet1:tab1:layoutPanel7:csvSubmitButton","widgetType":"webui.suntheme4_2.widget.button","style":"border: 1px inset black; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-weight: normal; height: 24px; width: 72px","visible":true,"primary":false,"value":"Submit","escape":true,"mini":false,"disabled":false});</script></span></td>

Thanks in advance guys.

Cheers
plasma33
 

Users who are viewing this thread

Back
Top Bottom