Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-31-2010, 11:16 AM
HowardC HowardC is offline Macro to download FTP File Windows XP Macro to download FTP File Office 2007
Novice
Macro to download FTP File
 
Join Date: May 2010
Posts: 21
HowardC is on a distinguished road
Default Macro to download FTP File

I have an excel workbook and need to import a file for eg East Vat Account.xls residing on an FTP site.I have written code to do this, but get a message "invalid code" at the user name and login. However, when running the script from a.bat file , it downloads into a directory called downloads perfectly. It would be appreciated if you could assist

My script is as follows:

open 18.2.14.196 (fictitious FTP)
user dave (fictitious)
password pass (fictitious)
bin
hash
lcd c:\downloads
** east
mget East Vat*.xls
quit

My VBA code is

Public Sub Ftp_Download_File()

Dim FTPcommand As String


Dim wsh As Object

FTPcommand = "ftp -n -s:" & Chr(34) & "C:\FTP_commands.txt" & Chr(34)
Set wsh = CreateObject("WScript.Shell")
wsh.Run FTPcommand, 5, True
End Sub
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for different file formats pengyou Office 0 04-06-2010 09:27 PM
Trying to download headers only tipitout Outlook 0 12-06-2009 06:29 AM
Macro to download FTP File Trying to download a .doc file from email or website on word 2007 on vista wilson723 Word 1 10-23-2009 11:17 AM
how do you download bcm with no disks? themeistress Outlook 0 02-22-2009 08:39 AM
Can't Download Controls BillTheAdmin Project 2 12-05-2005 10:20 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft