#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default embedded wav files

Is it possible to embed a wav file, used to signal an event, within a
workbook and then be able to take a copy of the excel file and get it to run
(with the sound file) on another computer?

Thanks for any advice.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default embedded wav files

Here is a start. the code below will find the embedded object and play th
etune. You can add the code to a worksheet open function to automatically
play the wav file when the workbook is opened.


Sub Playtune()

For Each obj In ActiveSheet.OLEObjects

'play ole object
obj.Activate

Next obj

End Sub



"ARGT" wrote:

Is it possible to embed a wav file, used to signal an event, within a
workbook and then be able to take a copy of the excel file and get it to run
(with the sound file) on another computer?

Thanks for any advice.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default embedded wav files

First insert the wav file like:

Insert Object... Create from File C:\Program Files\Microsoft
Office\OFFICE11\REMINDER.WAV

Then set the trigger. For example, this worksheet event macro will active
the sound if the value 1 is entered in cell A1:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set a1 = Range("A1")
If Intersect(t, a1) Is Nothing Then Exit Sub
If a1.Value < 1 Then Exit Sub
ActiveSheet.Shapes("Object 1").Select
Selection.Verb Verb:=xlPrimary
a1.Select
End Sub

--
Gary''s Student - gsnu200795


"ARGT" wrote:

Is it possible to embed a wav file, used to signal an event, within a
workbook and then be able to take a copy of the excel file and get it to run
(with the sound file) on another computer?

Thanks for any advice.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default embedded wav files

Thanks Joel and Gary's Student
The advice was just what I needed and it works well.

many thanks



"Gary''s Student" wrote:

First insert the wav file like:

Insert Object... Create from File C:\Program Files\Microsoft
Office\OFFICE11\REMINDER.WAV

Then set the trigger. For example, this worksheet event macro will active
the sound if the value 1 is entered in cell A1:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set a1 = Range("A1")
If Intersect(t, a1) Is Nothing Then Exit Sub
If a1.Value < 1 Then Exit Sub
ActiveSheet.Shapes("Object 1").Select
Selection.Verb Verb:=xlPrimary
a1.Select
End Sub

--
Gary''s Student - gsnu200795


"ARGT" wrote:

Is it possible to embed a wav file, used to signal an event, within a
workbook and then be able to take a copy of the excel file and get it to run
(with the sound file) on another computer?

Thanks for any advice.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default embedded wav files

Small problem. The embedding of the wav file worked well with Excel 2003 (on
one PC I use) but just causes Excel 2002 (on another machine) to hang up. It
just shows an insertion box and stops responding. Any ideas?



"Gary''s Student" wrote:

First insert the wav file like:

Insert Object... Create from File C:\Program Files\Microsoft
Office\OFFICE11\REMINDER.WAV

Then set the trigger. For example, this worksheet event macro will active
the sound if the value 1 is entered in cell A1:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set a1 = Range("A1")
If Intersect(t, a1) Is Nothing Then Exit Sub
If a1.Value < 1 Then Exit Sub
ActiveSheet.Shapes("Object 1").Select
Selection.Verb Verb:=xlPrimary
a1.Select
End Sub

--
Gary''s Student - gsnu200795


"ARGT" wrote:

Is it possible to embed a wav file, used to signal an event, within a
workbook and then be able to take a copy of the excel file and get it to run
(with the sound file) on another computer?

Thanks for any advice.


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
Embedded If Limitation Gaffnr Excel Worksheet Functions 10 February 5th 08 05:05 PM
limit on embedded IFs ? dkingston Excel Worksheet Functions 3 August 24th 06 08:17 PM
embedded ifs Daniel Q. Excel Worksheet Functions 3 July 25th 06 06:26 PM
Embedded objects Mike25 Excel Discussion (Misc queries) 1 March 23rd 06 03:05 PM
macros embedded Joe Excel Discussion (Misc queries) 2 January 27th 06 05:16 PM


All times are GMT +1. The time now is 05:45 AM.

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"