Timer control in Excel ?

rog1111
07-14-2001, 11:52 AM
Hi all
Has anyone been able to implant a VB timer control & routine into an Excel spreadsheet ? I cant seem to figure it out...
TIA
Roger

BlueRaja
07-16-2001, 09:22 AM
Hi,

There are probably a lot better ways of doing this but...You could try building an activex control with a timer in it like this...

Option Explicit

Public Event Alarm()

Public Sub setInterval(x As Integer)
Timer1.Interval = x
End Sub

Private Sub Timer1_Timer()
RaiseEvent Alarm
End Sub


....then open your spreadsheet - go to the controls toolbox in menus and select 'more controls' find your active x and put it in the sheet.

- then inside the vba for the sheet..


Private Sub MT1_Alarm()
MsgBox "hello world"
End Sub

Sub x()
MT1.setInterval 5000
End Sub

Good luck.

rog1111
07-17-2001, 03:39 AM
Thanks !
That looks as though it should work,I need to investigate this further.....
rog1111

"..he looked at the clock & saw that it was 11:11, how odd.."

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum