I am getting an error 91 (Object or with block variable not set) in my code which I have narrowed down to the point where it exits a function which has called an exported function from a dll.
I have the following line in my main module
Declare Function Lib "C:\winnt\system32\convd.dll" (ByVal inval as Double) as Double
And I have reproduced the error with the following code
Dim doubleval as double
Dim convertedval As Double
Private Sub Command1_Click()
Call test1
End Sub
Private Sub test1()
doubleval = 0.5
Call test2
End Sub
Private Sub test2()
convertedval = ConvD(doubleval)
End Sub
The error seems to occur on exiting test2(). My external function is called correctly as I can see the results. It can be called multiple times successfully but the error always occurs on exiting the function. Strangely, if I move the call to ConvD to inside test1() then the problem does not occur.
Any ideas or advice appreciated.
Cheers
PhilMcK
I have the following line in my main module
Declare Function Lib "C:\winnt\system32\convd.dll" (ByVal inval as Double) as Double
And I have reproduced the error with the following code
Dim doubleval as double
Dim convertedval As Double
Private Sub Command1_Click()
Call test1
End Sub
Private Sub test1()
doubleval = 0.5
Call test2
End Sub
Private Sub test2()
convertedval = ConvD(doubleval)
End Sub
The error seems to occur on exiting test2(). My external function is called correctly as I can see the results. It can be called multiple times successfully but the error always occurs on exiting the function. Strangely, if I move the call to ConvD to inside test1() then the problem does not occur.
Any ideas or advice appreciated.
Cheers
PhilMcK