总是提示“运行时错误‘13’ 类型不匹配”,请高手指点
各位大侠,我写了一个程序,前面加上了倒计时后,总是提示“运行时错误‘13’ 类型不匹配”,然后程序就不运行了。但在编辑状态下确没有错误提示,且后面的程序能正常运行,请高手指点一下,这是怎么回事?
Private Const SYNCHRONIZE = &H100000
Private Const INFINITE = &HFFFFFFFF
Private Declare Function CreateThread Lib "kernel32" (lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, ByVal lpParameter As Long, ByVal dwCreationFlags As Long, lpThreadId As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Dim tms As Integer
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
tms = Val(InputBox("输入倒计时秒数"))
Me.Caption = tms
End Sub
Private Sub Timer1_Timer()
Me.Caption = Me.Caption - 1
If Me.Caption = 0 Then
Timer1.Enabled = False
End If
End Sub