View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
juanpedro juanpedro is offline
external usenet poster
 
Posts: 1
Default How to run a shell command via VBA?


I am new to the forum and I agree , this is a great post. I do have a
related question.

I use vba to open an SSH tunnel using plink.exe the code I use is:

Shell Environ$("COMSPEC") & " /k c:\plink -ssh -l 'username' -pw
'password' -4 -L 3306:localhost:'IP address' """

I run it using the 'on open' function for the switchboard form in
Access. i can then access mysql tables from access.

THE QUESTION (finally !!) Is there a way I can close the shell window
using VBA at some later point (when I close access)?

It would be great if it would type "EXIT" first , but I suspect that is
not essential.

Thanks!!


Rick Rothstein;503270 Wrote:

As a follow up... the following is a compilation of several posts I've
given
in the past regarding the Shell command (over in the compiled VB

newsgroups,
but applicable to the VBA world) which may prove useful.



--
juanpedro
------------------------------------------------------------------------
juanpedro's Profile: http://www.thecodecage.com/forumz/member.php?u=2333
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=138407

http://www.thecodecage.com/forumz


--- news://freenews.netfront.net/ - complaints: ---