View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default playing a sound in a macro

After selecting the object I think you need a:

Selection.Verb Verb:=xlPrimary

The recorder should have generated this/
--
Gary''s Student


"Kelly 1st" wrote:

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
--
kelly m johnson
Great Britain


"Gary''s Student" wrote:

Post the macro
--
Gary''s Student


"Kelly 1st" wrote:

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
--
kelly m johnson