请问property let 是怎么用的。 为什么我的类模块用不了? 问题如下:我添加了一个类模块actor:Option Explicit
Private iID As IntegerPublic Property Let ID(newID As Integer) iID = newIDEnd PropertyPublic Property Get ID() As Integer ID = iIDEnd Property添加了一个模块:mainPublic lead As actor
窗体中跑一下命令:
lead.ID = 1Debug.Print lead.ID程序跑到 lead.ID=1报错:实时错误'91'
对象变量或with变量未设置
Private iID As IntegerPublic Property Let ID(newID As Integer) iID = newIDEnd PropertyPublic Property Get ID() As Integer ID = iIDEnd Property添加了一个模块:mainPublic lead As actor
窗体中跑一下命令:
lead.ID = 1Debug.Print lead.ID程序跑到 lead.ID=1报错:实时错误'91'
对象变量或with变量未设置
Public lead As actor '仅仅声明对象
set lead = new actor '对象需要初始化实例
lead.ID = 1 '然后才能访问该实例的成员
能不能帮忙看下我的问题啊 http://topic.csdn.net/u/20110310/12/f907e695-a9d6-4534-a7c8-dd5b33694ea9.html?83020 图在3层 谢谢