Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
using create object and sendkeys from excel to FTP
Hi,
I'm trying to dodwn load all the files in from an FTP site using VBA in Excel. I know there are probably lots of better other ways but this is what I've got so it has to be. I can create an object and start up FTP but I can't sendkeys to the window. it just puts the variables date into the active VBA window. I've tried all ways of addressing the object i've created but nothign has worked. anyone got a clue how I can sendkeys to this FTP window I've instantiated. Dim oshell As Object FTPSiteName As string Set oshell = CreateObject("Wscript.Shell") Set FTPSiteName as ftp.anysite.com oshell.Run "c:\windows\system32\ftp.exe" SendKeys "open " & FTPSiteName etc etc cheers Bobsa |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
using create object and sendkeys from excel to FTP
Can you share the actual url and the info you want from there?
-- Don Guillett SalesAid Software "Bobsa" wrote in message om... Hi, I'm trying to dodwn load all the files in from an FTP site using VBA in Excel. I know there are probably lots of better other ways but this is what I've got so it has to be. I can create an object and start up FTP but I can't sendkeys to the window. it just puts the variables date into the active VBA window. I've tried all ways of addressing the object i've created but nothign has worked. anyone got a clue how I can sendkeys to this FTP window I've instantiated. Dim oshell As Object FTPSiteName As string Set oshell = CreateObject("Wscript.Shell") Set FTPSiteName as ftp.anysite.com oshell.Run "c:\windows\system32\ftp.exe" SendKeys "open " & FTPSiteName etc etc cheers Bobsa |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
using create object and sendkeys from excel to FTP
I recentley did this using the command line FTP. This worked as such,
but in the real world the FTP site I really needed to work with was required "passive" FTP transfer, and well, the MS command line FTP won't do this. Workaround was to use a third party FTP program (WS_FTP) which allows a script file to be passed when the program is shelled out. Check their scripting help for the commands to put in the script. With that, I use VBA to write a temporary script file (which is deleted at the end of the module) based on user input (FTP location, account name, password, etc.) and then shell to WS_FTP using a method described by John Walkenbach in his Power Programming book to cause VBA to wait for the application to end. No sendkeys involved. Bobsa wrote: Hi, I'm trying to dodwn load all the files in from an FTP site using VBA in Excel. I know there are probably lots of better other ways but this is what I've got so it has to be. I can create an object and start up FTP but I can't sendkeys to the window. it just puts the variables date into the active VBA window. I've tried all ways of addressing the object i've created but nothign has worked. anyone got a clue how I can sendkeys to this FTP window I've instantiated. Dim oshell As Object FTPSiteName As string Set oshell = CreateObject("Wscript.Shell") Set FTPSiteName as ftp.anysite.com oshell.Run "c:\windows\system32\ftp.exe" SendKeys "open " & FTPSiteName etc etc cheers Bobsa |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
using create object and sendkeys from excel to FTP
Thanks for the reply but I really need the method of using sendkeys with
say a dos cmd object I've created. i've also got a list of files in an array which I need to step through and perform a PGP decrypt on. This is the only wayt I can think of doing it. So any ideas on the use of SENDKEYS with shell objects would be very useful thanks Bobsa *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
using create object and sendkeys from excel to FTP
ftp.exe works well from a batch file (my experience) and also can use
scripts (no experience). Either way, the .bat or .scp can be created on the fly in vba using open, print or write, close and then subsequently deleted if desired after execution. Rob Beaumont wrote: Thanks for the reply but I really need the method of using sendkeys with say a dos cmd object I've created. i've also got a list of files in an array which I need to step through and perform a PGP decrypt on. This is the only wayt I can think of doing it. So any ideas on the use of SENDKEYS with shell objects would be very useful thanks Bobsa *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create .NET object written in C# in Excel Macro | Excel Discussion (Misc queries) | |||
CREATE LIST OBJECT IN EXCEL | Excel Worksheet Functions | |||
Create (or find) a complete object tree for excel | Excel Programming | |||
Using vb to create an excel object and save it as a CSV file | Excel Programming | |||
Create a calendar object in Excel Cell | Excel Programming |