Hey all,

I'm currently working on a macro that, as the title says, downloads files from an ftp server into several worksheets. I used this link: http://officeone.mvps.org/vba/ftp_download_file.html to try and get somewhat of a headstart. I got as far as importing local files, thanks to the help of you experts here, into separate worksheets. Right now this is what I have to show(minus a few details):
 
Sub ftptest()
    MsgBox DownloadFile("ftp://ftp.whereEver.com", "username", "password", _
    "someCSV.csv", _
    "C:\Users\yourusername\Desktop\aFolder someCSV.csv")
End Sub

'Requires Reference: MSINET.OCX in Microsoft Internet Transfer Control
Function DownloadFile(ByVal HostName As String, _
    ByVal UserName As String, _
    ByVal Password As String, _
    ByVal RemoteFileName As String, _
    ByVal LocalFileName As String) As String
     
    Dim FTP As Inet
    
    Set FTP = New Inet
    With FTP
        .URL = HostName
        .Protocol = icFTP
        .UserName = UserName
        .Password = Password
        .Execute .URL, "Get " + RemoteFileName + " " + LocalFileName
        Do While .StillExecuting
            DoEvents
            OpenFileNewSheets 'this buggar here handles opening those lovely csv files
        Loop
        DownloadFile = (.ResponseCode = 0)
        
    End With
    Set FTP = Nothing
End Function

Sub OpenFileNewSheets()
'
'OpenFileNewSheets Macro
'
Dim Master As Workbook
Dim sourceBook As Workbook
Dim sourceData As Worksheet
Dim CurrentFileName As String
Dim myPath As String
Dim sname As String
Dim i As Long

Application.ScreenUpdating = False

'The folder containing the files to be recap'd
myPath = "C:\Users\yourusername\Desktop\aFolder"

'Finds the name of the first file of type .xls in the current directory
CurrentFileName = Dir(myPath & "\*.csv")

'Create a workbook for the recap report
Set Master = ThisWorkbook

Do
    Workbooks.Open (myPath & "\" & CurrentFileName)
    Set sourceBook = Workbooks(CurrentFileName)
    Set sourceData = sourceBook.Worksheets(1)
    
    With sourceData
        sname = Left(CurrentFileName, Len(CurrentFileName) - 4)
        Master.Worksheets.Add(after:=Master.Worksheets(Master.Worksheets.Count)).Name = sname
        .Cells.Copy Master.Worksheets(sname).Range("A1")
        
    End With
       
    sourceBook.Close
  
'Calling DIR w/o argument finds the next .xlsx file within the current directory.
CurrentFileName = Dir()
Loop While CurrentFileName <> ""

For i = 1 To Master.Worksheets.Count
    Master.Worksheets(i).Cells.EntireColumn.AutoFit
Next i

Application.ScreenUpdating = True

End Sub
The problem lies within the DownloadFile function. It will fall straight through the function, meaning it will go as far as the 'Do While' loop and completely skip it. Returning true. Please let me know what I am missing or if I need to rewrite this in a different manner. Your help is greatly appreciated!!