Group:  General ยป microsoft.public.officedev
Thread: Timer event failing sporadically -- Office 2007 VBA

Timer event failing sporadically -- Office 2007 VBA
"Tech_vs_Life" <limited[ at ]newsgroups.nospam> 4/17/2007 7:55:28 AM
After installing Office 2007 on 32-bit Vista Ultimate, the VBA timer event
periodically fails to fire (I'm using VBA in Microsoft Access).

So far, it fails about once a day, but once it fails, it fails several times
in a row. (The interval is set every 15000 millliseconds).

Any suggestions as to what could be the cause, or how to test it?

Thanks.




Re: Timer event failing sporadically -- Office 2007 VBA
"Tech_vs_Life" <limited[ at ]newsgroups.nospam> 6/29/2007 4:52:53 AM
I still haven't discovered a solution to this. I have turned off almost
every superfluous service (e.g. Windows Defender), but the VBA timer event
still fails to fire periodically (I have it set to fire every 13 seconds or
so, and every so often it will have a two to four minute or so gap between
firings). This occurs about twice a week in round the clock operation. The
same code had no problem in Windows XP and office 2003.

Anyone have any suggestions?

"Tech_vs_Life" <limited[ at ]newsgroups.nospam> wrote in message
news:B69B92DF-787F-41AF-9792-EA4E2C5E86BE[ at ]microsoft.com...
[Quoted Text]
> After installing Office 2007 on 32-bit Vista Ultimate, the VBA timer event
> periodically fails to fire (I'm using VBA in Microsoft Access).
>
> So far, it fails about once a day, but once it fails, it fails several
> times in a row. (The interval is set every 15000 millliseconds).
>
> Any suggestions as to what could be the cause, or how to test it?
>
> Thanks.
>
>
>
>

Re: Timer event failing sporadically -- Office 2007 VBA
"Allen Browne" <AllenBrowne[ at ]SeeSig.Invalid> 6/29/2007 5:04:19 AM
Curious. This could be quite hard to track down, as there could be so many
factors to examine.

What is the timer event doing? Presumably you are logging it to a table, so
you can identify the cases where it fails to fire.

Is it possible that the OS is tied up at the times when it fails, and so is
not giving CPU processor time to the Access appllication? For example, if
you copy/delete a large number of files in Vista, it can take a long time to
complete the operation, and if Access is a background application, it is not
getting any processing time for a few minutes?

Perhaps someone with a better understanding of how Vista manages resources
could comment on whether this line is worth investigating.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tech_vs_Life" <limited[ at ]newsgroups.nospam> wrote in message
news:CE0078D5-8AF9-492A-BB91-63636DE77A68[ at ]microsoft.com...
[Quoted Text]
>I still haven't discovered a solution to this. I have turned off almost
>every superfluous service (e.g. Windows Defender), but the VBA timer event
>still fails to fire periodically (I have it set to fire every 13 seconds or
>so, and every so often it will have a two to four minute or so gap between
>firings). This occurs about twice a week in round the clock operation. The
>same code had no problem in Windows XP and office 2003.
>
> Anyone have any suggestions?
>
> "Tech_vs_Life" <limited[ at ]newsgroups.nospam> wrote in message
> news:B69B92DF-787F-41AF-9792-EA4E2C5E86BE[ at ]microsoft.com...
>> After installing Office 2007 on 32-bit Vista Ultimate, the VBA timer
>> event periodically fails to fire (I'm using VBA in Microsoft Access).
>>
>> So far, it fails about once a day, but once it fails, it fails several
>> times in a row. (The interval is set every 15000 millliseconds).
>>
>> Any suggestions as to what could be the cause, or how to test it?

Re: Timer event failing sporadically -- Office 2007 VBA
"Tech_vs_Life" <limited[ at ]newsgroups.nospam> 6/30/2007 11:38:59 PM
Thanks for your help. As you say, this is one of those issues one despairs
of ever resolving because of all the variables.

I'm doing a debug.print (prints to a window in VBA). I've tracked where the
VB code is at every step, and it's doing nothing at all at the time the
Timer Event should fire.

The timer event (which is supposed to fire every 15 seconds) has been
reduced to this:
Debug.Print "before:" & Now()
If Minute(now) = 4 Then DoSomeX 'DoSomeX just does some more logging
Debug.Print "after: " & Now()

The debug window shows that the timer "forgets" to fire for a few minutes at
a time, randomly about twice a week, but only AFTER printing "after:"--so
it's not that some code in DoSomeX is preventing the timer event from
firing. Yes, there could be other things Vista is doing that prevents the
timer from firing, but I find that doubtful. First, at the list of times it
fails I've seen no CPU activity or disk activity, and no events in the event
viewer. Second, I've shutdown practically every Vista service that could be
shutdown (including disk defragmenter, the Windows Defender, System Restore,
Firewall, windows Search/indexer, and basically everything except basic
networking). I don't have antivirus on this system, which is usually a
culprit in mystery behavior (and no viruses on this system either).

Is there some alternative api code that I should use to get to the Windows
timer or system clock directly from within VBA (using a declare)? I suppose
I'd need callbacks to do that--but I need to get this to work. The
identical vba code worked flawlessly in Windows XP and office 2003, on the
same hardware. it could be that a bug has been introduced when vba Timers
are left running continuously for a long time, but it could be something
else entirely.




"Allen Browne" <AllenBrowne[ at ]SeeSig.Invalid> wrote in message
news:eZYI3rguHHA.4540[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text]
> Curious. This could be quite hard to track down, as there could be so many
> factors to examine.
>
> What is the timer event doing? Presumably you are logging it to a table,
> so you can identify the cases where it fails to fire.
>
> Is it possible that the OS is tied up at the times when it fails, and so
> is not giving CPU processor time to the Access appllication? For example,
> if you copy/delete a large number of files in Vista, it can take a long
> time to complete the operation, and if Access is a background application,
> it is not getting any processing time for a few minutes?
>
> Perhaps someone with a better understanding of how Vista manages resources
> could comment on whether this line is worth investigating.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Tech_vs_Life" <limited[ at ]newsgroups.nospam> wrote in message
> news:CE0078D5-8AF9-492A-BB91-63636DE77A68[ at ]microsoft.com...
>>I still haven't discovered a solution to this. I have turned off almost
>>every superfluous service (e.g. Windows Defender), but the VBA timer event
>>still fails to fire periodically (I have it set to fire every 13 seconds
>>or so, and every so often it will have a two to four minute or so gap
>>between firings). This occurs about twice a week in round the clock
>>operation. The same code had no problem in Windows XP and office 2003.
>>
>> Anyone have any suggestions?
>>
>> "Tech_vs_Life" <limited[ at ]newsgroups.nospam> wrote in message
>> news:B69B92DF-787F-41AF-9792-EA4E2C5E86BE[ at ]microsoft.com...
>>> After installing Office 2007 on 32-bit Vista Ultimate, the VBA timer
>>> event periodically fails to fire (I'm using VBA in Microsoft Access).
>>>
>>> So far, it fails about once a day, but once it fails, it fails several
>>> times in a row. (The interval is set every 15000 millliseconds).
>>>
>>> Any suggestions as to what could be the cause, or how to test it?
>

Home | Search | Terms | Imprint
Newsgroups Reader