Thread View: comp.lang.basic.visual.database
6 messages
6 total messages
Started by Steve Silberberg
Mon, 10 Nov 1997 00:00
Help with Shell command from VBA in Excel
Author: Steve Silberberg
Date: Mon, 10 Nov 1997 00:00
Date: Mon, 10 Nov 1997 00:00
30 lines
1698 bytes
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!
Re: Help with Shell command from VBA in Excel
Author: Jim Rech
Date: Mon, 10 Nov 1997 00:00
Date: Mon, 10 Nov 1997 00:00
4 lines
964 bytes
964 bytes
Shell takes a WindowStyle argument. Check it out in Help. Jim
Re: Help with Shell command from VBA in Excel
Author: Steve Silberberg
Date: Tue, 11 Nov 1997 00:00
Date: Tue, 11 Nov 1997 00:00
13 lines
1329 bytes
1329 bytes
In article <eEQUdEg78GA.99@uppssnewspub04.moswest.msn.net>, "Jim Rech" <jarech@kpmg.com> wrote: >Shell takes a WindowStyle argument. Check it out in Help. Thanks. I tried it, but I think "SendKeys" is failing to send the Alt-P to Media Player. ---------------- 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!
Re: Help with Shell command from VBA in Excel
Author: Jim Rech
Date: Tue, 11 Nov 1997 00:00
Date: Tue, 11 Nov 1997 00:00
9 lines
1153 bytes
1153 bytes
We're not communicating. I'm asking what happens when you supply the window style parameter like this: Shell "c:\winnt\system32\mplay32.exe /Play /Close c:\warning.wav", 1 No Sendkeys at all. Jim
Re: Help with Shell command from VBA in Excel
Author: Steve Silberberg
Date: Tue, 11 Nov 1997 00:00
Date: Tue, 11 Nov 1997 00:00
29 lines
2011 bytes
2011 bytes
In article <eMSu6op78GA.266@uppssnewspub04.moswest.msn.net>, "Jim Rech" <jarech@kpmg.com> wrote:
>We're not communicating. I'm asking what happens when you supply the window
>style parameter like this:
>
>Shell "c:\winnt\system32\mplay32.exe /Play /Close c:\warning.wav", 1
>
>No Sendkeys at all.
Jim,
THANK YOU THANK YOU THANK YOU!!!!!!
That worked great! The philosophical bit of information I was missing was the
command line parameters to mplay32.exe. I didn't realize that Excel was
working fine, but the player needed command line switches. I pored over
mplay32's on-line documentation and found no mention of it. Furthermore,
mplay32 /?
returns nothing in Dos. So THANK YOU again.
One more question if I may. How do I get this warning to play as an
auto execution macro at start up?
Steve
----------------
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!
Re: Help with Shell command from VBA in Excel
Author: Davie
Date: Tue, 11 Nov 1997 00:00
Date: Tue, 11 Nov 1997 00:00
32 lines
1862 bytes
1862 bytes
Steve,
You can assign you macro to Workbook auto_open
event.
Private Sub Auto_Open()
Your Macro
End Sub ()
Regards, Davie
Steve Silberberg wrote:
That worked great! The philosophical bit of information I was missing was the
> command line parameters to mplay32.exe. I didn't realize that Excel was
> working fine, but the player needed command line switches. I pored over
> mplay32's on-line documentation and found no mention of it. Furthermore,
> mplay32 /?
> returns nothing in Dos. So THANK YOU again.
>
> One more question if I may. How do I get this warning to play as an
> auto execution macro at start up?
> Steve
>
> ----------------
> 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!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads