🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual.database
Article #60

Help with Shell command from VBA in Excel

#60
From: Steve Silberberg
Date: Mon, 10 Nov 1997 00:00
30 lines
1698 bytes
I have an Excel form with a button.  When the button is clicked, I'd like 
 it to play a verbal warning.  I try to accomplish this with:

        Shell ("c:\winnt\system32\mplay32.exe  c:\warning.wav")

This results in the Media Player being opened, and then immediately
being minimzed and placed on the taskbar.

I am able to bring it to the foreground with:

        Sendkeys "%{TAB}"

Which simultes the Alt-Tab (what a kludge).  Then I try to play it with:

        Sendkeys "%P"

which doesn't work.  However, if I run this code, and then press
Alt-P myself, the thing plays.

Help!  How can I do this?  Many, many thanks.
Steve
PS:  I've also unsuccessfully tried this with sndrec32.exe

----------------
Steve Silberberg
mailto:stevebo@onramp.net
Visit the Air Sickness Bag Museum at:
http://rampages.onramp.net/~stevebo/airsick.html
FACT:  Buff Babes Dig Cut Dudes!
Technical Details
Message-ID: <646ctu$l5j@news.onramp.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fd1b2,32ea6480e39b375
X-Google-Attributes: gidfd1b2,public
X-Google-Thread: 1143a7,32ea6480e39b375
X-Google-Attributes: gid1143a7,public
X-Google-Thread: 10b213,32ea6480e39b375
X-Google-Attributes: gid10b213,public
X-Google-Thread: fad30,32ea6480e39b375
X-Google-Attributes: gidfad30,public
X-Google-Thread: 1112c7,32ea6480e39b375
X-Google-Attributes: gid1112c7,public
From: stevebo@onramp.net (Steve Silberberg)
Subject: Help with Shell command from VBA in Excel
Date: 1997/11/10
Message-ID: <646ctu$l5j@news.onramp.net>
X-Deja-AN: 288928789
Organization: Callipygian Productions
Newsgroups: comp.lang.basic.visual.database,dfw.test,microsoft.public.excel.misc,microsoft.public.vb.controls,microsoft.public.word.vba