- This topic has 6 replies, 2 voices, and was last updated 15 years, 10 months ago by Anonymous.
March 31, 2005 at 3:04 pm #3931AnonymousInactive
im trying to build this simple vb macro for excel which basically closes the opened workbook when its idle for a couple of minutes.
i know how to call the function to close etc.
at moment i have this called at the opening of the book and it closes the book after 10 seconds.
what i want to know is, is there a function which gets called when the spreadsheet is idle. i.e. so i can put a timer or something, which when it goes off it calls my shutdown?
Seems like a common enough think you’d want to do, but ive spent 2 hours looking on the web and the doc on vb is bloody shocking. seems like theres no api documentation for the fecking language.
also while im at it, is there a function which gets called repeatively when the workbook is active? i.e. where i can reset the timer
March 31, 2005 at 4:10 pm #19178AnonymousInactive
Hmmm, you might only frustrate yourself trying to do this with VBA for Excel.
If you only have one sheet in your workbook you might look at the Workbook SheetActivate event. I haven’t used it myself but perhaps you could activate your timer in there.
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
//Your code here
The most thorough VB resource on the web is at MSDN, http://msdn.microsoft.com/vbasic/ but if you haven’t found an answer to your question using Google it’s unlikely to be out there on the web.
March 31, 2005 at 4:12 pm #19179AnonymousInactive
nice one thanks for the help
ya i suspect if google can find it, its not there :)
March 31, 2005 at 4:18 pm #19183AnonymousInactive
Well, I’m not sure how much help it really is. You can go round in circles trying to find out how to do exactly what you want in VB!
March 31, 2005 at 4:20 pm #19185AnonymousInactive
i hate the feckin things. its not a real programming language at all. they made the thing so high level and vague that its useless.
March 31, 2005 at 4:28 pm #19187AnonymousInactive
Eep! Ah, it’s not all that bad, just very inflexible for a programming language. It’s good at what it’s good at (rapid development, accessing recordsets, that kinda lark) and terrible at what it’s not.
Also the syntax examples they give in documentation are generally not varied enough to be of any real help.
March 31, 2005 at 4:30 pm #19188AnonymousInactive
give me C++ or java any day.
- The forum ‘General Discussion’ is closed to new topics and replies.