View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chaplain Doug Chaplain Doug is offline
external usenet poster
 
Posts: 127
Default How to update a control without screen flashing

Excel 2003. I have a workbook I call "Switchboard" with multiple sheets. On
each sheet I have some controls, one of which is a text window that I use to
display the status of a program that is running as a result of pressing a
control button on the sheet. The code that is running does open some other
workbooks temporarily, but focus is retained by the "Switchboard" workbook.
However, when I try to update the status text control using the following
code, the other open workbooks flash up momentarily and then focus is
returned to the Switchboard workbook and sheet. How may I eliminate this
"flash"? Here's the code:

Public Sub UpdateStatus(UStatus As String)
Dim SUOff As Boolean
If Application.ScreenUpdating = False Then
SUOff = True
Application.ScreenUpdating = True
End If
ThisWorkbook.ActiveSheet.ProcessStatus.Value = UStatus
ThisWorkbook.ActiveSheet.ProcessStatus.Activate
If SUOff Then Application.ScreenUpdating = False
End Sub

The call would be "Call UpdateStatus("Processing workbook x")"
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org