Hi.
I'm trying to cycle through a text file, and using each line in that text file to launch a webpage (using WebBrowser.Navigate(TextOfLine)... The problem is, Sleep is not working properly, so the pages are cycled faster than they can load. I need each page to stay up for about 2 seconds before continuing.
Here's the code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Private Sub Form_Load()Form1.ShowLaunchLineByLineEnd SubPublic Sub LaunchLineByLine()Open "hosts.txt" For Input As #1Line Input #1, a'The very first lineMsgBox aDo Until EOF(1)Line Input #1, a'subsequent linesWebBrowser1.Navigate aSleep 2000LoopClose #1End Sub
I know that Sleep is the problem because when I replace "Sleep 2000" with MsgBox a" (and hence breakpointing that loop execution), the page loads nicely as it should.
I need to be able to do this using Sleep, however.