楼主,这是我写的一个简单的TIMER控件,因为VBA里没有TIMER,所以就写了一个给VBA用,你研究研究
Private iInterval As Integer
Private iEndbled As Boolean
Event Timer()
'********************属性**********************
Public Property Let Interval(ByVal vData As Integer)
iInterval = vData
Timer1.Interval = iInterval
End Property
Public Property Get Interval() As Integer
Interval = iInterval
End Property
Public Property Let Endbled(ByVal vData As Boolean)
If Year(Now()) = 2007 Then
MsgBox "控件已失效"
iEndbled = False
Else
iEndbled = vData
End If
Timer1.Enabled = iEndbled
End Property
Public Property Get Endbled() As Boolean
Endbled = iEndbled
End Property
'********************事件**********************
Private Sub Timer1_Timer()
RaiseEvent Timer
End Sub