Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create .NET object written in C# in Excel Macro Tom Chau Excel Discussion (Misc queries) 0 April 11th 06 07:38 AM
CREATE LIST OBJECT IN EXCEL MIKE Excel Worksheet Functions 0 June 20th 05 08:13 AM
Create (or find) a complete object tree for excel Alan Excel Programming 6 February 11th 04 09:34 PM
Using vb to create an excel object and save it as a CSV file eli silverman[_2_] Excel Programming 1 December 4th 03 10:15 PM
Create a calendar object in Excel Cell Kzeto Excel Programming 2 August 8th 03 12:19 PM


All times are GMT +1. The time now is 04:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"