mp3 or wav in code - how do I stop once played

garcia96

New Member
Joined
Dec 9, 2013
Messages
27
here is code that works good until it repeats and does not end until manual stop - help


Sub PLAYSONG()

REQ_B = 100001
'skip1 for PLAY_Q test
' GoTo NOK
'skip1 end
Application.ScreenUpdating = False
If REQ_B > 199999 Then
GoTo NOK
Else

DR_L = ActiveCell.Address: DR_A = Application.ActiveCell.Row
DR_K = "": Range(DR_G).Select
For DR_H = 1 To DR_J
Selection.Find(What:=DUP_B, Lookat:=xlWhole).Activate
DR_P = ActiveCell.Offset(-(ActiveCell.Row() - 1), 0).Value
If DR_H = DR_J Then
DR_K = DR_K & DR_P
Else: DR_K = DR_K & DR_P & " ¦ "
End If
DR_M = ActiveCell.Address
Range(DR_M & ":" & ("GD" & ActiveCell.Row)).Select
Next
Range("IncludeOnShows").Value = DR_K: Sheets("Display").Activate
Range("A1").Activate
End If
NOK:
PLAY_G = 0: Play_A = Range("FileLoc").Value
PLAY_D = Range("LinkAddress").Value: PLAY_B = FileLen(Play_A)
PLAY_B = PLAY_B / 10584062: PLAY_B = Round(PLAY_B, 5): PLAY_E = Len(PLAY_B)
PLAY_C = Application.Search(".", PLAY_B): PLAY_F = Int(Left(PLAY_B, PLAY_C - 1)) ' minutes

If Len(Right(PLAY_B, PLAY_E - PLAY_C)) = 5 Then
PLAY_G = (Int(Right(PLAY_B, PLAY_E - PLAY_C)) * 0.00001)
ElseIf Len(Right(PLAY_B, PLAY_E - PLAY_C)) = 4 Then
PLAY_G = Int(Right(PLAY_B, (PLAY_E - PLAY_C)) & "0") * 0.00001
ElseIf Len(Right(PLAY_B, PLAY_E - PLAY_C)) = 3 Then
PLAY_G = Int(Right(PLAY_B, (PLAY_E - PLAY_C)) & "00") * 0.00001
ElseIf Len(Right(PLAY_B, PLAY_E - PLAY_C)) = 2 Then
PLAY_G = Int(Right(PLAY_B, (PLAY_E - PLAY_C)) & "000") * 0.00001
ElseIf Len(Right(PLAY_B, PLAY_E - PLAY_C)) = 1 Then
PLAY_G = Int(Right(PLAY_B, (PLAY_E - PLAY_C)) & "0000") * 0.00001
ElseIf Len(Right(PLAY_B, PLAY_E - PLAY_C)) = 0 Then
PLAY_G = Int(Right(PLAY_B, (PLAY_E - PLAY_C)) & "00000") * 0.00001
End If
PLAY_G = (PLAY_G * 60) ' seconds
Range("LinkAddress").Activate
'skip2 for PLAY_Q
' GoTo Skip3
'skip2 for PLAY_Q
'hypercreate
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=Play_A, _
TextToDisplay:=Play_A
'hyperend
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Sheets("fIELD").Activate
'Dim P_SHAPES As ShapeRange: Set P_SHAPES = ActiveSheet.Shapes.Range("PlayButton")
Application.ScreenUpdating = True: Application.ScreenUpdating = False

'Skip3:
If PLAY_F > 60 Then
PLAY_K = Round(PLAY_F / 60, 0): PLAY_F = PLAY_F - (60 * PLAY_K)
Else
PLAY_K = 0
End If

End Sub
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,215,472
Messages
6,125,005
Members
449,203
Latest member
Daymo66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top