LISTING 1: Load the frmGetFile Form Public Function GetFile(ByVal aURL As String, ByVal aFile As String, ByVal aUsername As String, ByVal aPassword As String) As String On Error GoTo ErrRtn Load frmGetFile Dim b() As Byte 'aURL is the valid URL being passed in frmGetFile.Inet1.URL = aURL ‘Only set the username and password if the username is passed in to the function. If aUsername <> "" Then frmGetFile.Inet1.UserName = aUsername frmGetFile.Inet1.Password = aPassword End If ‘Get the data b() = frmGetFile.Inet1.OpenURL(, icByteArray) ‘Write it to a file. Open aFile For Binary Access _ Write As #1 Put #1, , b() Close #1 Xit: On Error Resume Next Unload frmGetFile Exit Function ErrRtn: GetFile = Err.Number & "|" & Err.Description & "|" & Err.Source GoTo Xit End Function