inserting wav files

B

Boatman

I am making a spreadsheet in which I want to include sound icons which will
play a predetermined wav file when double-clicked (or otherwise activated).
I have tried imbedding objects which works pretty good, but every time I
double-click on the icon, not only does it play the sound file (good) but it
"activates" the picture for editing (the box with the handles) (bad).

I would appreciate any methods to correct this, or other ways to imbed sound
files in a spreadsheet.

Thanks!

Boatman
 
E

Earl Kiosterud

Boatman,

I haven't messed with EMBED. The Playsound method will play short wavs, but
if they're too long to fit in one load to the sound card, it just ignores
them. I've been shelling from Excel to Winamp in a playist workbook I use
in live music engagements. Turns Excel into a big juke-box with repertoire
and playlist, driven from the laptop keyboard. It's been reliable. I'm not
sure you want to use an external player, though.
 
S

ste mac

Hi Boatman, l got the code below from a good excel site (the problem
is
l can't remember which one!) it was J Walkebach or Chip Pearson,
someone
like that... anyway as long as the sound file is in the same directory
as the workbook...this code will do it...

HTH

seeya ste


'Windows API function declaration
Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Long

Function Alarm(Cell, Condition)
Dim WAVFile As String
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
On Error GoTo ErrHandler
If Evaluate(Cell.Value & Condition) Then
WAVFile = "c:\Tools & Info\Excel Trick Stuff\Noise based on cell
value\unstoppable.wav " 'Edit this statement"
Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME)
Alarm = True
Exit Function
End If
ErrHandler:
Alarm = False
End Function
'Create a module, get this code, bang it in then, in the worksheet
stick this formula in...
'=Alarm=(cell,"criteria")
'You may have to change the word..alarm..as windows thinks its
ambiguous
 
P

Peo Sjoblom

I hope this file is for your use only, if I ever got a file with sounds or
flashing cells the first thing I would do would be to turn off. It might
look and sound cool for awhile but it is really annoying in the long run..
 

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

Top