FTP Transfer help

nehpets12

Active Member
Joined
Feb 22, 2002
Messages
453
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
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
This website is pretty much the standard for file transfer via ftp code:
http://www.bygsoftware.com/Excel/VBA/ftp.htm

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:
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,208
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top