I am trying to play a sound file according to what is entered within a cell. The code I have is:
This code works fine if I put it at the beginning of the worksheet_change on the sheet, however, I have tried to move the calling of the sounds into a separate sub so I can use it in other ways, but get an object required runtime error.If Target.Cells.Value = 0 Then
Call PlaySoundFile("C:\Users\Number1.wav")
End If
Any ideas why it works ok within worksheet_change and why it doesn't in a separate sub that is just getting called from worksheet_change?
Also, any ideas on how to change this so I can get it to work?
Thanks in advance
Bookmarks