ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   using create object and sendkeys from excel to FTP (https://www.excelbanter.com/excel-programming/294955-using-create-object-sendkeys-excel-ftp.html)

Bobsa

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

Don Guillett[_4_]

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




JWolf

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


Rob Beaumont

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!

JWolf

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!



All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com