If anyone can offer any advice on how to do this, it would be much
appreciated.
Thanks,
Tino
"Tino" <tana...@ingram.com.au> wrote in message
news:mh9mg9...@firewall.ingram.com.au...
If you can't get that to work, take a look at the following sites.
This MSDN article is from 1996, but I know someone who used this solution in
VB6, so I assume it will work in VBA.
http://msdn.microsoft.com/library/default.asp?URL=/library/techart/msdn_advf
tp.htm
This is a rather involved solution, but it is a solution. From an MVP page:
http://www.mvps.org/vbnet/index.html?code/network/ftplist.htm
Alternatively, there are a bunch of ActiveX controls available out there
that would simplify the task.
"Vasant Nanavati" <vas...@aol.com> wrote in message
news:#d4m1bG#AHA.1256@tkmsftngp05...
http://msdn.microsoft.com/downloads/samples/Internet/networking/vbftpjr/samp
le.asp
"Jeff McAhren" <mca...@hotmail.com> wrote in message
news:ecKF0vG#AHA.1444@tkmsftngp05...
HOWEVER, I am using my home machine at this moment, which has never seen
Visual Studio, and yet I DO have the file, comctl32.ocx. WinME, IE5.5,
Office 2000 Pro.
"Jeff McAhren" <mca...@hotmail.com> wrote in message
news:Oj8KNyG#AHA.236@tkmsftngp04...
>If you can't get that to work, take a look at the following sites.
Probably work very easily if Samba is set up on the Unix box.
Behind a user form that collects userid and password:
====================================================
Private Function do_ftp(strFile As String) As Boolean
myuserid = Trim(TextBox2.Text)
mypassword = Trim(TextBox3.Text)
On Error GoTo do_ftpError
intFileNum = FreeFile()
Close #intFileNum
Open myftptxt_file For Output As #intFileNum
'Create the FTP Command File.
Print #intFileNum, "open xxxxxxx"
Print #intFileNum, myuserid
Print #intFileNum, mypassword
Print #intFileNum, "put " & work_directory & strFile
Print #intFileNum, "bye"
Close #intFileNum
'Execute the FTP Commands to upload the file.
ShellAndWait "ftp.exe -v -s:" & work_directory & "myftp.txt",
vbMinimizedNoFocus
'Delete both temporary files.
Kill myftptxt_file
Kill work_directory & strFile
do_ftp = True
Application.StatusBar = False
Exit Function
do_ftpError:
Close #intFileNum
MsgBox "FTP Failed: The VB Error Was As Follows:" & _
Chr(13) & Error(Err), vbCritical
do_ftp = False
End Function
Myftptxt_file holds the ftp commands and myftp.txt holds the ASCII (for me) data
I want transfered. (I actually use this to go from the PC to mainframe.)
And I use ShellandWait to wait for the ftp to finish:
Standard Module:
================
Option Explicit
Private Const PROCESS_QUERY_INFORMATION As Long = &H400
Private Const STILL_ACTIVE As Long = &H103
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As
Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As
Long, lpExitCode As Long) As Long
''' Arguments: szCommandLine The command line to execute using Shell.
''' iWindowState (Optional) The window state parameter to pass
''' to the Shell function. Default = vbHide.
''' See Shell function help for other options.
Sub ShellAndWait(ByVal szCommandLine As String, Optional ByVal iWindowState As
Integer = vbHide)
Dim lTaskID As Long
Dim lProcess As Long
Dim lExitCode As Long
Dim lResult As Long
''' Run the Shell function.
lTaskID = Shell(szCommandLine, iWindowState)
''' Get the process handle from the task ID returned by Shell.
lProcess = OpenProcess(PROCESS_QUERY_INFORMATION, 0&, lTaskID)
''' Loop while the shelled process is still running.
Do
''' lExitCode will be set to STILL_ACTIVE as long as the shelled process
is running.
lResult = GetExitCodeProcess(lProcess, lExitCode)
DoEvents
Loop While lExitCode = STILL_ACTIVE
End Sub
--
Dave Peterson
ec3...@msn.com
--
Jeff McAhren
Dallas, Texas
"Dave Peterson" <ec3...@msn.com> wrote in message
news:3B2FC24E...@msn.com...