Hi All,
I am working on an webpage whre I need to click on a browse button to upload files. I am using the FindWindow(vbNullString, "Choose File To Upload") option to do the same. The problem is after clicking on the browse button with the below code I am unable to proceed further as the script pauses there itself. It's not setting the file name to the new dialog box. Please help me on this as I am very much new to such automation
' Code to click the browse button on the page
ie.Document.forms(0).all("ctl00_m_g_f8801725_4d67_4567_a5c8_1b554c76a3d4_ctl00_btnUpload1").Click
Script hangs here and unable to perform the below lines and I am not sure where the control is (If I cancel the Upload Window manually, the control returns to the module) :
Dim Ret
Ret = FindWindow("ThunderFormDC", "Choose File To Upload")
If Ret <> 0 Then
MsgBox "File upload window Found"
SetForegroundWindow (Ret)
Else
MsgBox "File upload window Not Found"
End If
'C:\Users\somu\Desktop\Resume_Somnath Sinha.doc
SendKeys "^v"
SendKeys "{ENTER}"
MsgBox "DONE"
I am working on an webpage whre I need to click on a browse button to upload files. I am using the FindWindow(vbNullString, "Choose File To Upload") option to do the same. The problem is after clicking on the browse button with the below code I am unable to proceed further as the script pauses there itself. It's not setting the file name to the new dialog box. Please help me on this as I am very much new to such automation
' Code to click the browse button on the page
ie.Document.forms(0).all("ctl00_m_g_f8801725_4d67_4567_a5c8_1b554c76a3d4_ctl00_btnUpload1").Click
Script hangs here and unable to perform the below lines and I am not sure where the control is (If I cancel the Upload Window manually, the control returns to the module) :
Dim Ret
Ret = FindWindow("ThunderFormDC", "Choose File To Upload")
If Ret <> 0 Then
MsgBox "File upload window Found"
SetForegroundWindow (Ret)
Else
MsgBox "File upload window Not Found"
End If
'C:\Users\somu\Desktop\Resume_Somnath Sinha.doc
SendKeys "^v"
SendKeys "{ENTER}"
MsgBox "DONE"