FTP Transfer help


Active Member
Feb 22, 2002
I have no idea if this is possible.

I would like to write some code to transfer some files to another computer using FTP.
I know the directory file path of the file I want to transfer and I know the IP address of the remote computer and the directory I want to add the file.

What code do I need to do this?

I also read that I need to reference Microsoft Internet Transfer Control

I cant find this on my referance menu?

I have done a search for MSINET.OCX on my computer but it can not find it. Is it something that should be there or do I have to download this control?

I have found a referance to microsoft internet controls but I am not sure if this is what I need

I am using Windows 7

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"


New Member
Dec 28, 2009
This website is pretty much the standard for file transfer via ftp code:

If you just want code that works, give it a shot, it should be good. (If you do want specific explanations as to what various lines of code are doing, post up your questions, and I'll answer when I have the time). The code works fine for me without ever having considered Microsoft Internt Transfer Conrtol.

A couple of observations:

'' To receive a file, replace the above line with this one
''Print #lInt_FreeFile01, "recv \Picture.gif " & ThisWorkbook.Path & "\Picture.gif"

I've found when receiving files, I get a blank file unless I remove the red slash - I'm sure for some people it works either way, but that may save you some trouble.

Secondly, the ftp -s: command does not work with spaces, so if you're sending from or receiving to a location like your personal macro workbook, or your desktop, which typically has a file path of C:\Documents and Setting\... the spaces in that file path will cause the code to lock up in the do while loop infinitely. You need to make sure that the various file paths have no spaces.
Last edited:

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Latest member

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...