Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is a shortened list of sounds in column R, sheet 1. And is the list for a data validation drop down in H1.
C:\Windows\Media\ir_end.wav C:\Windows\Media\ringout.wav C:\Windows\Media\Speech Misrecognition.wav This is in Module 1: Option Explicit Private Declare Function sndPlaySound Lib "winmm.dll" _ Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Const SND_SYNC = &H0 Const SND_ASYNC = &H1 Const SND_LOOP = &H8 Const SND_PURGE = &H40 Public Sub SoundPlayAsyncOnce(Sound As String) 'SND_SYNC to play assynchron sndPlaySound Sound, SND_ASYNC End Sub This is in sheet1 vb editor: Option Explicit Private Declare Function sndPlaySound32 _ Lib "winmm.dll" _ Alias "sndPlaySoundA" ( _ ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub TingleTunes() 'Dim iSnd As string 'Set iSnd = Range("H1").Value 'SoundPlayAsyncOnce iSnd.Value 'SoundPlayAsyncOnce iSnd.Value SoundPlayAsyncOnce ActiveCell.Value End Sub As is, it works fine to select a sound in R column and run Sub TingleTunes(). The commented out code lines is my attempt to select a sound from the drop down and run TingleTunes to play the selected sound. I get object required error. Thanks. Howard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Assign Sub Name to a Variable | Excel Programming | |||
Assign value to a variable name | Excel Discussion (Misc queries) | |||
Assign my own sound from a list to a command button | Excel Programming | |||
Assign value to variable | Excel Discussion (Misc queries) | |||
assign variable | Excel Programming |