ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   embedded wav files (https://www.excelbanter.com/excel-discussion-misc-queries/195563-embedded-wav-files.html)

ARGT

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.



joel

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.



Gary''s Student

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.



ARGT

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.



ARGT

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.




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com