Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP

Status
Not open for further replies.

ihaveaproblem

Programmer
Jul 4, 2003
14
GB
Is it possible to FTP a file to an external IP address by using code in VBA?
 
I would imagine u could use the Shell() to send a command line. Should work although I've never done FTP. I've done other Shell stuff... Like run a .BAT file. htwh,

...
'create a directory listing by writing a batch file and executing it
sCommand = "dir " & lcBase_Path & "*.mdb /s /b /o-s >" & APP_PATH & "dir_list_mdb.lst"
Open APP_PATH & "dir.bat" For Output As #1
Print #1, sCommand
Close #1

wHandle = Shell(APP_PATH & "dir.bat")
DelayTime 10 'delay to wait for the directory list, required becasue Shell command is asyncronous.
appLoop wHandle

Open APP_PATH & "dir_list_mdb.lst" For Input As #1 'open the directory list file and load table


...
Public Function DelayTime(PauseTime As Integer)
Dim start
start = Timer ' Set start time.
Do While Timer < start + PauseTime
DoEvents ' Yield to other processes.
Loop
End Function

Sub appLoop(wHandle As Long)
On Error GoTo errorhandler
Do While 1
AppActivate wHandle, False
Loop
errorhandler:
Exit Sub
End Sub

Steve Medvid
&quot;IT Consultant & Web Master&quot;
e-Mail: Stephen_Medvid@GMACM.com

Chester County, PA Residents
Please Show Your Support...
 
U may also want to consider adding an FTP check DIR to confirm that the file is there? Although not sure how to code it...

Steve Medvid
&quot;IT Consultant & Web Master&quot;
e-Mail: Stephen_Medvid@GMACM.com

Chester County, PA Residents
Please Show Your Support...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top