Shell Commands

  • Thread starter Thread starter Wayne
  • Start date Start date
W

Wayne

Hello,

I have a spreadsheet that uses the following to utalise
Windows Messaging Service:

Shell "Net send (pc name) (message)"

this loops several times to send multiple messages as I
can't greate a batch file due to system limitations. The
problem is this creates numerous cmd boxes on the task
bar, these do eventually disappear but it is fairly
untidy.
Is there any way I can stop the cmd boxes appearing
without using batch files?

Thanks
Wayne
 
Hi Wayne,
You just need to pipe the shell through the command processor. The /c kills
the cmd window when it's finished.

MyMessage = Shell(Environ$("comspec") & " /c Net send (pc name)
(message)",vbNormalFocus)

I'll assume pc name & message are variables so...(you'll need to loose that
space delimiter)

MyMessage = Shell(Environ$("comspec") & " /c Net send "& pcname & " " &
message,vbNormalFocus)

....should work for you. (watch the line wrap. Should be all one line)

--
John
johnf 202 at hotmail dot com


| Hello,
|
| I have a spreadsheet that uses the following to utalise
| Windows Messaging Service:
|
| Shell "Net send (pc name) (message)"
|
| this loops several times to send multiple messages as I
| can't greate a batch file due to system limitations. The
| problem is this creates numerous cmd boxes on the task
| bar, these do eventually disappear but it is fairly
| untidy.
| Is there any way I can stop the cmd boxes appearing
| without using batch files?
|
| Thanks
| Wayne
 

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

Back
Top