Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

All Desired files won't download of a webpage

IanLevitanIanLevitan Posts: 1Member
So I'm trying to download four files off a webpage (all .csv files) and save them to the desktop. I access each file using it's ID number from the webpage source code (As seen in pasted code below). However, I think the timing if off because everytime I run it I miss one to two files and each time I run the program, it is a different two files. Any help would be great.


I have the inserted
"While ie.busy
DoEvents
Wend"
Still in because I thought that would help out with the timing of the program.

[u]Code:[/u]
Sub hh()
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")

ie.Visible = True

ie.navigate "http://sbsprd2.natfuel.com/psc/sbsprd/NFSBS/sbsprd/c/NFOM_INFORMATIONAL_POSTINGS.NFOC_OPER_AVAIL_1.GBL"

While ie.busy
DoEvents
Wend


ie.document.getElementById("NF_WRK_NF_FLOW_DT_FROM").Value = InputBox("Beginning Date")
ie.document.all("NF_WRK_NF_FLOW_DT_THRU").Click
While ie.busy
DoEvents
Wend
ie.document.all("NF_WRK_NF_SELECTED_SW").Click

While ie.busy
DoEvents
Wend

ie.document.all("NF_WRK_NF_DESCR254_2$1").Click
While ie.busy
DoEvents
Wend
ie.document.all("NF_WRK_NF_DESCR254_2$7").Click
While ie.busy
DoEvents
Wend
ie.document.all("NF_WRK_NF_DESCR254_2$13").Click
While ie.busy
DoEvents
Wend
ie.document.all("NF_WRK_NF_DESCR254_2$19").Click


While ie.busy
DoEvents
Wend

ie.document.all("$ICField11").Click

While ie.busy
DoEvents
Wend

ie.document.all("NF_WRK_NF_DESCR254_2$1").Click
While ie.busy
DoEvents
Wend
ie.document.all("NF_WRK_NF_DESCR254_2$7").Click
While ie.busy
DoEvents
Wend
ie.document.all("NF_WRK_NF_DESCR254_2$13").Click
While ie.busy
DoEvents
Wend
ie.document.all("NF_WRK_NF_DESCR254_2$19").Click
End Sub

Sign In or Register to comment.