Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default status update during program run -- DoEvents doesn't always work

Hello --

I've got a program or two that do some lengthy and time consuming mass edits
to Excel workbooks. I use code like this to inform the user of the progress
of the program.

Function UpdateWorkbook () as Boolean

txtStatusUpdate.text = "Processing data block one"
DoEvents
'* update logic for data block 1 goes here

txtStatusUpdate.text = "Processing data block two"
DoEvents
'* update logic for data block 2 goes here

'* etc.

End Function

Sometimes the status indicator text box updates and sometimes it doesn't.
I've also tried this by creating a label and changing its caption property,
and sometimes these don't update either.

Is there something else I should try or check?

Thanks,
Mark VII
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default status update during program run -- DoEvents doesn't always work

You can try a couple of kludges:
kludge 1: use 2 DoEvents in a row:
DoEvents
DoEvents
(hopefully) the second will flush anything that the first missed. It
worked for me once when I encountered a similar problem.

kludge 2 (if first fails)

Start = Timer
Do while Timer < Start + 0.1 'if you can spare a 10th of a second
DoEvents
Loop

Maybe someone knows a less kludgy way.

HTH

-John Coleman

Mark VII wrote:
Hello --

I've got a program or two that do some lengthy and time consuming mass edits
to Excel workbooks. I use code like this to inform the user of the progress
of the program.

Function UpdateWorkbook () as Boolean

txtStatusUpdate.text = "Processing data block one"
DoEvents
'* update logic for data block 1 goes here

txtStatusUpdate.text = "Processing data block two"
DoEvents
'* update logic for data block 2 goes here

'* etc.

End Function

Sometimes the status indicator text box updates and sometimes it doesn't.
I've also tried this by creating a label and changing its caption property,
and sometimes these don't update either.

Is there something else I should try or check?

Thanks,
Mark VII


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default status update during program run -- DoEvents doesn't always wo

I tried kludge #1, and it worked OK. Am going to call it good there, and
keep kludge #2 in mind for later if I need it.

Thanks a million for the suggestion.

Mark




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
reuest formula for auto update status & status date PERANISH Excel Worksheet Functions 5 June 2nd 08 04:26 PM
Why doesn't status bar update consistently? amazingm Excel Programming 4 August 15th 06 03:26 PM
Display Program Status Rookie_User Excel Programming 2 July 18th 06 12:11 AM
Why doesn't status bar update consistently? [email protected][_2_] Excel Programming 16 February 1st 06 07:53 AM
How to display a form- to show status of the running program Joseph Excel Discussion (Misc queries) 2 May 31st 05 11:31 AM


All times are GMT +1. The time now is 06:41 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"