假设我有一个名为的自定义库(.dll);库.dll
在库中,有一个类叫做;班级
我生成一个名为 testObject 的对象:
Dim testObject As New Library.Class
有一个函数叫做 testFunction:
Function testFunction(var1 As Double, var2 As Double, var3 As Double, var4 As Double, _
var5 As Double, var6 As Integer, var7 As Double, var8 As Double, var9 As Double)
Call testSetup(var1, var2, var3, var4, var6, var7, var8, var9)
testFunction = testObject.Field(var5)
End Function
此函数调用 testSetup:
Sub testSetup(var1 As Double, var2 As Double, var3 As Double, var4 As Double, _
var5 As Double, var6 As Integer, var7 As Double, var8 As Double, var9 As Double)
testObject.Lat1 = var1
testObject.Lon1 = var2
testObject.Lat2 = var3
testObject.Lon2 = var4
testObject.mth = var6
testObject.GMT = var7
testObject.ssn = var8
testObject.icf = var9
End Sub
我遇到的问题是,在运行时,如果我在该位置放置一个断点
testObject.Lat1 = var1
在运行并跨到下一行时,如果我将鼠标悬停在对象上
testObject.Lat1
我看到了错误
对象变量或未设置块变量
没有崩溃,也没有导致失败的明确错误消息。
有人有想法么?
我不确定错误是在库还是代码中?
它也可以通过输入单元格 =testFunction(var1, var2, var3....) 从 excel 中运行
编辑:评论中的更多信息