Ken Crawford
09-18-2014, 04:22 PM
Hi all,
Long time since I was here last time.
I want to write a macro which would do the following
Go to tinyeye(dot)com website and click Browse to select local fixed image from disk (file path e.g C:\image.jpg)
Macro would then click OK after file path is chosen
So far I came up to below code:
Sub Button1_Click()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate "tinyeye(dot)com"
Do While ie.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set objCollection = ie.Document.getElementsByTagName("input")
i = 0
While i < objCollection.Length
If objCollection(i).ID = "upload_box" Then
objCollection(i).Click
End If
i = i + 1
Wend
End Sub
I am out of ideas now how to make VBA to pick C:\image.jpg file so then it can click OK. Can any good soul help here? :bug:
Long time since I was here last time.
I want to write a macro which would do the following
Go to tinyeye(dot)com website and click Browse to select local fixed image from disk (file path e.g C:\image.jpg)
Macro would then click OK after file path is chosen
So far I came up to below code:
Sub Button1_Click()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate "tinyeye(dot)com"
Do While ie.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set objCollection = ie.Document.getElementsByTagName("input")
i = 0
While i < objCollection.Length
If objCollection(i).ID = "upload_box" Then
objCollection(i).Click
End If
i = i + 1
Wend
End Sub
I am out of ideas now how to make VBA to pick C:\image.jpg file so then it can click OK. Can any good soul help here? :bug: