When I run my program I got the following error, "Method ~ of object ~ failed"

But when I debugged the code, I got the exact error, "Method name of object IWave failed" from the below code


Public Function PlotWave(WaveIn As AlgsLib.IWave) As Boolean
.....
WaveIn.name = DuplicateNameforUntitled
.....
End Function


I thought this is there is some problem with the method 'name'. Then I skipped this code and executed the remaining code. Then again different error came from the below code, "Method samplerate of object IWave failed"


Private Function Plot(WaveIn As Waveform) As Boolean


samplerate = WaveIn.DSPWave.samplerate


Where DSPWave is,


Public Property Get DSPWave() As IWave
Set DSPWave = m_DSPWave
End Property


By looking all these, the problem should be with the interface IWave. But the reference to this dll is properly added. (Also if the problem is with reference, in compile time itself it should show up).

How to get rid of this problem?