rogster001
New Member
- Joined
- Jun 17, 2010
- Messages
- 45
Hi all,
I have been playing around with some little VBA projects by way of learning the language, to give me something to focus on i have implemented a couple of things that are traditional programming projects like the Conway Game of Life which i have done in other languages.
It is most amusing seeing excel doing things like this, and i am learning a lot.
The program works perfectly as a alt+f8 macro call, colouring in the cells according to the algorithm, looks rather cool too.
The problem i am having is keeping the interface responsive while the program runs, i need a 'check' function that looks for any events periodically, to prevent the gui hanging.
I read about the application.DoEvents function, but i get an error saying object property is not defined... i beleive this as it was not in the list of available properties that appeared in the popupbox, yet it still compiled. i imagiune this is because i am using it in the wrong place? or type?
Here is the code snippet:
I have been playing around with some little VBA projects by way of learning the language, to give me something to focus on i have implemented a couple of things that are traditional programming projects like the Conway Game of Life which i have done in other languages.
It is most amusing seeing excel doing things like this, and i am learning a lot.
The program works perfectly as a alt+f8 macro call, colouring in the cells according to the algorithm, looks rather cool too.
The problem i am having is keeping the interface responsive while the program runs, i need a 'check' function that looks for any events periodically, to prevent the gui hanging.
I read about the application.DoEvents function, but i get an error saying object property is not defined... i beleive this as it was not in the list of available properties that appeared in the popupbox, yet it still compiled. i imagiune this is because i am using it in the wrong place? or type?
Here is the code snippet:
Code:
Sub GameOfLife()
SetupWorld
For j = 1 To 100 'number of generations
UpdateWorld ' the algorithm, scans 50x50 cells grid and
'populates acccording to algorithm
Application.DoEvents 'I would like to check for events here.
Next j
End Sub