Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Playing a sound file from Excel

Here's what I'm trying to do - any help is appreciated.

I have an Excel workbook with several worksheets. I want an audio file (in
..wma format) to start playing when I activate a worksheet. I've been able to
play a .wav file using the sndPlaySound32 dll but it doesn't seem to work
with a .wma file.

Any suggestions??

Thanks in advance,
Larry


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Playing a sound file from Excel


One solution could be inserting the WMA fila as an object and call it
from the code with:

'Replace "Object 4" with the name of your object
ActiveSheet.Shapes("Object 4").Select
Selection.Verb Verb:=xlPrimary

...the only thing is that it will be open on your default player.

Regards.


--
dbarelli
------------------------------------------------------------------------
dbarelli's Profile: http://www.excelforum.com/member.php...o&userid=31275
View this thread: http://www.excelforum.com/showthread...hreadid=511093

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Playing a sound file from Excel


One solution could be inserting the WMA fila as an object and call it
from the code with:

'Replace "Object 4" with the name of your object
ActiveSheet.Shapes("Object 4").Select
Selection.Verb Verb:=xlPrimary

...the only thing is that it will be open on your default player.

Regards.


--
dbarelli
------------------------------------------------------------------------
dbarelli's Profile: http://www.excelforum.com/member.php...o&userid=31275
View this thread: http://www.excelforum.com/showthread...hreadid=511093

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Playing a sound file from Excel


One solution could be inserting the WMA fila as an object and call it
from the code with:

'Replace "Object 4" with the name of your object
ActiveSheet.Shapes("Object 4").Select
Selection.Verb Verb:=xlPrimary

...the only thing is that it will be open on your default player.

Regards.


--
dbarelli
------------------------------------------------------------------------
dbarelli's Profile: http://www.excelforum.com/member.php...o&userid=31275
View this thread: http://www.excelforum.com/showthread...hreadid=511093

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Playing a sound file from Excel

One solution could be inserting the WMA fila as an object and call it from
the code with:

'Replace "Object 4" with the name of your object
ActiveSheet.Shapes("Object 4").Select
Selection.Verb Verb:=xlPrimary

....the only thing is that it will be open on your default player.

Regards.

"Larry" wrote:

Here's what I'm trying to do - any help is appreciated.

I have an Excel workbook with several worksheets. I want an audio file (in
.wma format) to start playing when I activate a worksheet. I've been able to
play a .wav file using the sndPlaySound32 dll but it doesn't seem to work
with a .wma file.

Any suggestions??

Thanks in advance,
Larry




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default Playing a sound file from Excel

Hi Larry;
(sFile = Full name of wma file)

Private Sub WMAPlay(sFile$)
If Len(Dir(sFile)) < 8 Then Exit Sub
CreateObject("WMPlayer.OCX").URL = sFile
End Sub

MP

"Larry" a écrit dans le message de news:
...
Here's what I'm trying to do - any help is appreciated.

I have an Excel workbook with several worksheets. I want an audio file

(in
.wma format) to start playing when I activate a worksheet. I've been able

to
play a .wav file using the sndPlaySound32 dll but it doesn't seem to work
with a .wma file.

Any suggestions??

Thanks in advance,
Larry




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Playing a sound file from Excel

put this in a REGULAR module

Option Private Module
Declare Function sndPlaySound Lib "WINMM.DLL" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Private Sub playmysound()
SoundName$ = "c:\TakeFive\TakeFive.wav"
'SoundName$ = "c:\" & [myfolder] & "\" & [myfile] & ".wav"
wFlags% = SND_ASYNC Or SND_NODEFAULT
counter = 0
Do Until counter = [timestoplay]
x% = sndPlaySound(SoundName$, wFlags%)
counter = counter + 1
Loop
End Sub

--
Don Guillett
SalesAid Software

"Larry" wrote in message
...
Here's what I'm trying to do - any help is appreciated.

I have an Excel workbook with several worksheets. I want an audio file
(in
.wma format) to start playing when I activate a worksheet. I've been able
to
play a .wav file using the sndPlaySound32 dll but it doesn't seem to work
with a .wma file.

Any suggestions??

Thanks in advance,
Larry




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Playing a sound file from entry in cell NG99 Excel Discussion (Misc queries) 2 January 31st 07 12:27 AM
playing a sound in a macro Kelly 1st Excel Programming 5 November 28th 05 12:30 PM
Playing sound in VBA Pete[_22_] Excel Programming 3 October 10th 05 02:01 PM
playing sound??? tess457[_6_] Excel Programming 2 October 20th 04 11:50 AM
Playing a sound base on cell value Mike[_58_] Excel Programming 4 November 30th 03 03:53 AM


All times are GMT +1. The time now is 06:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"