View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Mark de Niet Mark de Niet is offline
external usenet poster
 
Posts: 1
Default Sub or Function not defined..

Hi, I see that I'm like what, almost 2 months late and you probably already found a solution, but I stumbled upon these posts since I was looking for a hint for how to play .wav files in excel (triggered by a time event, btw).
Had this error message all the time: "sub or function not defined", and the problem seemed to be with the PlayWavFile. The error didn't occur anymore after I put the "ThisWorkbook" class or reference or whatsitcalled in front of it. The Sub procedure is in my Module1 and apparently, if i call a procedure From the Module, I need to refer to it, not as "PlayWavFile", but "ThisWorkbook.PlayWavFile". Otherwise the compiler doesn't find it ("not defined")
Cheers