Samadhan Gaikwad
Member
I have a macro which copies selected cell value in one fixed cell and further it send that value from fixed cell to web page and hit button. But don't know why it do not run completely sometimes. It just opens IE page without adding value in textarea of web page.
Code:
Sub OpenPRdatapage()
Dim str, URL As String
Dim IE, frm As Object
Dim wb As WebBrowser
Dim objElement As Object
Dim objCollection As Object
On Error Resume Next
Selection.Copy
Range("G1").Select
ActiveSheet.Paste
str = Sheets("Hyperlink_To_PR").Range("G1").Value
URL = "https://tiweb.industrysoftware.automation.com/prdata/cgi-bin/n_prdata_index.cgi"
Set IE = CreateObject("Internetexplorer.Application")
IE.Visible = True
IE.Navigate URL
Do
Loop While IE.Busy
IE.Document.getElementsByName("pr_numbers")(0).Value = str
Application.SendKeys ("~")
Call IE.Document.getElementsByTagName("button").Item(1).Click
Do
Loop While IE.Busy
Application.CutCopyMode = False
End Sub