Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Can you auto-trigger a sound file to play when a worksheet opens?
I would like to have a sound wave play automatically when I open a particular
Excel worksheet. I have already added the sound wave into the worksheet, but can't seem to find out how to have it self-trigger. Anyone have experience with this. Working on Windows XP Thanks |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Can you auto-trigger a sound file to play when a worksheet opens?
Put these in a standard module:
Private Declare Function playSound Lib "winmm.dll" _ Alias "PlaySoundA" (ByVal lpszName As String, _ ByVal hModule As Long, ByVal dwFlags As Long) As Long Sub Play_A_Wav() WAVFile = ThisWorkbook.Path & "\Your.wav" Call playSound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME) End Sub In the worksheet you want it to play when you open put: Private Sub Worksheet_Activate() Call Play_A_Wav End Sub HTH "Nanotexan" wrote: I would like to have a sound wave play automatically when I open a particular Excel worksheet. I have already added the sound wave into the worksheet, but can't seem to find out how to have it self-trigger. Anyone have experience with this. Working on Windows XP Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Double-clicking .xls file opens Excel but doesn't open the file | Excel Discussion (Misc queries) | |||
Weird File Open/Save As Behavior | Excel Discussion (Misc queries) | |||
clicking .XLS file opens Excel 2003 but doesn't find the file | Excel Discussion (Misc queries) | |||
Excel opens, but not the file | Excel Discussion (Misc queries) | |||
when i open a file a new excel window opens. how do stop this | Excel Discussion (Misc queries) |