I am making a primitive database in Excel and need a routine to run in the background constantly. I will be able to fill in the actual actions it needs to do, but I don't know how to make something run independent of a key press or some sort of Macro. If someone can give me an example of code that runs independently which I can simply fill with contents, that would be much appreciated.
views:
36answers:
2
A:
I haven't worked with VBA for quite some time now, but you would have to create a thread in VBA, maybe by COM-Threading, but I am not too sure if Excel is threadsafe or if you even can use Threads of some kind in Excel. Another alternative would be a Timer. If it is not implemented in VBA and I don't remember it to be, you would have to create the Timer yourself and react to the Windows Message yourself, if you can do that in VBA.
All in all I think this uses case might be to big for an Excel VBA Macro. If I were you I would consider doing this in a different way.
HalloDu
2010-02-23 21:37:54
PERFECT! Thank you very much for the help.
Jerome
2010-02-24 13:16:43
@Jerome: make sure to accept the answer if it suits your needs, it'll help others with similar questions. And welcome to StackOverflow!
guitarthrower
2010-02-24 15:53:24