Copy Sync with Shell

M

MTechG

I can launch a cmd with a command from vba but would I'd like to do is get
the results from the shell session back to Excel. I haven't seen anything on
this.

TIA
 
D

Dave Peterson

I bet you haven't seen anything because it would depend on what program you're
launching.

Maybe you could have that program write to a text file and then have your VBA
code open that text file and read what it wants.

If you know that the other program works quickly, you could
shell
wait 5 seconds (or whatever you think is appropriate)
open the text file
read the data.

If you don't know how long it'll take to do the program in the shell, then there
are other ways to wait.

http://support.microsoft.com/?kbid=214248
XL2000: How to Force Macro Code to Wait for Outside Procedure
or

Here's a link to a nice ShellAndWait function:
http://groups.google.com/groups?threadm=ump2dlfcBHA.1656@tkmsftngp03

==========
All this could be moot if you don't have some control over how the other program
can share the results.
 

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