I need to execute my shell script present in my unix/solaris box via giving login id and password and ftp the files from unix box to my windows machine using VBA macros.
Please share the VBA code.
Thanks in advance.
Printable View
I need to execute my shell script present in my unix/solaris box via giving login id and password and ftp the files from unix box to my windows machine using VBA macros.
Please share the VBA code.
Thanks in advance.
I don't know what VBA support there is for Solaris but as far as I can tell it's doable using an ordinary shell script. See this http://www.cs.bgu.ac.il/~arik/usail/...ris/ftp.1.html
There is no native FTP support in VBA, but Windows has an ftp command line tool much like the Solaris one. It supports the same command line options as those described in the Solaris docs linked to by S_M_A except -t plus a few more, and the meaning of -v apparently is reversed. You should be able to run the tool using the VBA Shell function.
Don't know anything of the unix/solaris box. If you can use win32api there's a bunch of sample code to use wininet functions like InternetConnect, InternetOpen, FtpGetFile, FtpPutFile. You can loop files on an ftp server using hFind=FtpFindFirst and hFind=InternetFindNextFile (only for one hFind at the same time). If you want to loop recursively you can first loop the ftp root, create the found directories in a local tempfolder and loop them while requesting it from the ftp sever.
But keep in mind, wininet does not support ftps or sftp, so only ftp is possible. In my own situation I wanted a secure connection for backup files and decided to use wininet for https upload.