playing a sound in a macro

G

Guest

hello,

I'm trying to play a sound through a macro. I record the macro, during
which, i right click on my media file, choose play, it plays then the macro
continues to do something else whilst the sound is playing. However when i
run the macro, the sound doesn't play - can anyone help?

Thanks
 
G

Guest

all the stuff underneath the first 2 lines is what the macro does - the first
2 lines are where i press the sound wav sound... (I have inserted it as a
media clip... then attached my own sound to it)

Sub data()
'
' data Macro
' Macro recorded 23/11/2005 by Kelly Johnson
'

'
Range("D10").Select
ActiveSheet.Shapes("Object 36").Select
Range("D9").Select
Sheets("Data Collection").Select
Rows("5:5").Select
Range("BM5").Activate
Selection.Insert Shift:=xlDown
Sheets("Technical Audit").Select
Range("C2:C22").Select
Selection.Copy
Sheets("Data Collection").Select
Range("BM5").Select
ActiveWindow.ScrollColumn = 1
Range("A5").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveWindow.SmallScroll ToRight:=18
Sheets("Technical Audit").Select
ActiveWindow.SmallScroll Down:=15
Range("C25:C77").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Data Collection").Select
Range("V5").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveWindow.ScrollColumn = 69
Sheets("Technical Audit").Select
ActiveWindow.SmallScroll Down:=54
Range("D68:D73").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Data Collection").Select
Range("BW5").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Sheets("Technical Audit").Select
Range("C70").Select
ActiveWindow.SmallScroll Down:=-48
Range("C23:C24").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Data Collection").Select
Range("CD5").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Sheets("Technical Audit").Select
ActiveWindow.SmallScroll Down:=-24
Range("C3:C77").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("C3").Select
End Sub
 
G

Guest

After selecting the object I think you need a:

Selection.Verb Verb:=xlPrimary

The recorder should have generated this/
 
G

Guest

I embedded an mp3 file and it played if my application was open before
running the macro.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top