#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Sound Code

Bob,

The error you are getting sound as though you have something declared twice,
hence the ambiguous.

However, you also have a couple of other problems. If you have the PlaySound
API declared in Module 1, it needs to be Public not Private to be accessed
from other modules. Also, the Constants SND_ASYNC and SND_FILENAME are
being referenced in Sheet8, they need to be declared there, not in Module 1.
I would suggest just moving all of the Module 1 code to Sheet8, and removing
Module 1.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bob" wrote in message
...
Here is what I have done.

I have this in Module 1:

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

And have this in sheet 8:

Private Sub CommandButton1_Click()
WAVFile =

"C:/Program/Files/Netscape/Communicator/Program/AIM/Sounds/dooropen.wav"
Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME)
End Sub

Then the error: Ambigous Name detected

Im sorry I don't understand.



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
Sound with excel bau Excel Discussion (Misc queries) 0 March 9th 08 11:21 PM
Sound on Excel girgor Excel Discussion (Misc queries) 5 March 3rd 08 05:49 PM
add a sound if cell A180, A290, B1100, etc..... Astroboy Excel Discussion (Misc queries) 4 March 2nd 08 11:20 PM
Play sound aac Excel Discussion (Misc queries) 2 December 5th 07 11:24 PM
can I add sound to a spreadsheet? add sound to spreadsheet Excel Discussion (Misc queries) 4 February 20th 06 11:08 PM


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