Hello,
I'm trying to programmatically upload a file on my own FTP account using the code below. I somehow managed to fill up the login page and click the login button but, I cannot click the upload button by similar code for clicking the upload button.
Is there anyone who can help me with this?
Best Regards and thanks in advance.
Here's the HTML content of the webpage after successfully logging in.
I'm trying to programmatically click the Upload button but cannot find the elements to be used.
Sub FTPUpload()
Set IE = CreateObject("InternetExplorer.application")
IE.Visible = True
strURL = "http://www.txftp.com/index.php"
IE.Navigate strURL
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
'Fill-up login page
Set doc = IE.Document
doc.getElementsByClassName("form-text")(0).Value = "123.45.678.90"
doc.getElementsByClassName("form-text")(1).Value = "MyFTPUserName"
doc.getElementsByClassName("form-text")(2).Value = "MyFTPPassWord"
doc.getElementsByClassName("form-text")(3).Value = "/InitialDirFolder"
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
'Click login button
doc.getElementsByClassName("formbuttonsAlt2")(0).Click
Do While IE.Busy
Loop
doc.getElementsByClassName("smallbutton")(3).Click 'This doesn't work
End Sub
Bookmarks