Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Excel - Generating Sounds


Hi all,

Could anybody tell me how to generate a sound?

I need to play a sound every time I finish running a macro.

Thanks in advance,
Aldo

--
ajliak
-----------------------------------------------------------------------
ajliaks's Profile: http://www.excelforum.com/member.php...nfo&userid=819
View this thread: http://www.excelforum.com/showthread.php?threadid=26136

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default VBA Excel - Generating Sounds

Hi
see:
http://j-walk.com/ss/excel/tips/tip59.htm

--
Regards
Frank Kabel
Frankfurt, Germany


ajliaks wrote:
Hi all,

Could anybody tell me how to generate a sound?

I need to play a sound every time I finish running a macro.

Thanks in advance,
Aldo.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default VBA Excel - Generating Sounds

Hi ajliaks, I use this code, just put the sound file in the same folder/
directory and call it by the macro and it should work...


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

Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000

Sub playmywavfile()
WAVFile = "thewavyouwanttoplay.wav"
WAVFile = ThisWorkbook.Path & "\" & WAVFile
Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME)
End Sub

hope this helps...

seeya ste
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
HOW DO I PUT SOUNDS IN EXCEL Kellsangel1952 Excel Discussion (Misc queries) 2 May 8th 07 05:11 PM
Excel Sounds donpauleon Excel Discussion (Misc queries) 2 July 25th 06 07:49 AM
sounds in Excel Green Wizard Excel Discussion (Misc queries) 2 March 9th 06 05:26 PM
Excel Sounds Trojan Excel Discussion (Misc queries) 5 November 20th 05 09:42 AM
Sounds in Excel J. Vandenberg Excel Programming 5 September 29th 03 03:46 PM


All times are GMT +1. The time now is 02:01 PM.

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

About Us

"It's about Microsoft Excel"