Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VBA interrupts...

Hi all,

Does VBA allow process interrupts from a Timer and if so, how is this
implemented..? I have written a simple progress bar in the status bar
and have a timer created using the following API commands:

Public Declare Function SetTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long) As Long

When I set the timer it calls my specified on every interval. I was
hoping to use this timer to increment my progress bar.

The task that is taking a while to execute is as follows:

dim rstData as ADODB.Recordset
Set rstData = New ADODB.Recordset

rstData.Open "C:\Temp\outRS.rst"

Opening this persistent recordset takes about 30 seconds and being a
VBA function I cannot access the code that loops and reads in this
recordset to add a DoEvents or the code to update the progress bar. I
was hoping that the Timer I have created would interrupt this process,
call the progress bar update procedure and then resume the load but
this is not the case. How can I implement a progress bar when one
statement takes 30seconds and I want a progress indication of that..?

Thanks in advance,
Lyndon.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Add-in for SQL Server Analysis Services: interrupts my Macro. Zoo Excel Programming 0 November 11th 05 02:24 AM


All times are GMT +1. The time now is 03:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"