using create object and sendkeys from excel to FTP

B

Bobsa

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
 
J

JWolf

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.
 
R

Rob Beaumont

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!
 
J

JWolf

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top