In broad terms, yes this is possible.

At the end of the process, you will end up with three text files: a "flag" file, a batch file and a "query output" text file. If you want to be tidy, you can kill the flag file and the batch file after you have recovered the data. In fact you can kill the query output file.

The steps would be:

1. kill a "flag" file at the beginning of the process. This is a simple text file and does not need any content.
2. in Excel, build a batch file to run your command
run the "query" and route the output to a text file ... one line output
as the last task in the batch file, re-create the "flag" file
3. use shell to open a CMD box and run the batch file you just created
4. in the Excel code, loop until the flag file exists; you need to put a realistic time limit on this loop
5. when it does, the batch file is complete
open and read the query text file output
store the content in the cell
6. kill all the three text files.

Done


Regards, TMS