Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21238

FindWindow(vbNullString, "Choose File To Upload")

$
0
0
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"

Viewing all articles
Browse latest Browse all 21238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>