Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Nanotexan
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jeffP
 
Posts: n/a
Default 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
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
Double-clicking .xls file opens Excel but doesn't open the file DG Excel Discussion (Misc queries) 4 January 6th 06 02:20 AM
Weird File Open/Save As Behavior [email protected] Excel Discussion (Misc queries) 0 December 9th 05 02:26 AM
clicking .XLS file opens Excel 2003 but doesn't find the file Arrow Computer Excel Discussion (Misc queries) 2 August 10th 05 03:51 AM
Excel opens, but not the file WWBWB Excel Discussion (Misc queries) 3 July 11th 05 01:45 PM
when i open a file a new excel window opens. how do stop this susan Excel Discussion (Misc queries) 1 July 1st 05 03:08 PM


All times are GMT +1. The time now is 09:35 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"