Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendkeys to close a popup window

Status
Not open for further replies.

elac

Technical User
Jul 9, 2002
14
BE
Hello,

I'm using VBA in MS Access to FTP files from a server and load them into my tables.
I found a free FTP client shareware (FCE) in but as soon as I open the client from vba a popup window is displayed.

I tried to use SendKeys {ENTER},False to automatically close it but the window stays opened.

Does anybody have a suggestion about SendKeys or about another FTP client ?

Thanks in advance.

elac
 
This is only a thought...

If using SendKeys solution try using CTRL and F4 combination. It's a long time since I used SndKeys but I remember it being a real pain at times as you have to send the info at just the right point in your routine.

Be careful if you try this method as CTRL+F4 closes the active window

;-) If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Hi Loomah,

I tried your suggestion but it doesn't work even in interactive mode.

Thanks anyway

elac
 
Have you tried introducing a delay between calling the FTP application and issuing the sendkeys? Sendkeys goes to the active window - if the active window, when you send it, is still Access, then it won't have the desired result.
Rob
[flowerface]
 
In fact, I initiate the SendKeys before calling the FTP application because the goal is to automatically answer to the popup window displayed by this application.

I tried also the following code :

SendKeys "{ENTER}", False
Msgbox "Hello"

In this case, it works. The message box is displayed and automatically disappears. But with my FTP client, it doesn't work even with a few seconds sleep between SendKeys and the FTP client activation.
 
The reason it works with your msgbox is because the keys go to the active application (Access), which holds them until it needs them (when your msgbox comes up). It won't work with the FTP application, because Access is holding the keystrokes, not the FTP program.
Rob
[flowerface]
 
Would an ftp batch file do the job of your ftp software?



in a text file...


the batch would look something like this
in a text file......


open ftp.your.ftp.site.here
your logon name
your password
cd incoming\data
put z:\my_path\myfile.txt
quit


then in a batch file....

ftp -s:c:\your_text_file.txt -d

name the batch file witha .bat extention...


then call your batch file with the shell command in vba.


 
Of course, I could use a FTP commands file with shell in vba. If I don't find a solution to automatically close the FTP client reminder window, I will probably swith to that solution.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top