Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.office.developer.vba
Dhruba Bandopadhyay
 
Posts: n/a
Default HELP: MsgBox takes 99% CPU usage... why?

I got a problem with my Excel macro. It does some calculations then displays
a message box. However the message box is actually

displayed before the window maximize so what actually happens is the user
sees the minimised Excel blinking in the taskbar.

The problem is I have been told this blinking uses 50% of the CPU or almost
100% CPU usage. Is this normal? Is it waiting in a for

loop prompt?




Public Sub Updates_Off()
With Application
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
End With
End Sub

Public Sub Updates_On()
With Application
.StatusBar = False
.ScreenUpdating = True
.DisplayAlerts = True
.EnableEvents = True
.EnableCancelKey = xlInterrupt
.Cursor = xlDefault
.Calculation = xlCalculationAutomatic
End With
End Sub

Private Sub Workbook_Open()
Updates_Off
Application.WindowState = xlMinimized
Updates_On
Response = MsgBox("Test", vbYes + vbCritical, "Template Message")
Application.WindowState = xlMaximized
Application.Quit
End Sub



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
HELP: MsgBox takes 99% CPU usage... why? Dhruba Bandopadhyay New Users to Excel 0 May 22nd 06 01:23 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Excel takes along time to calculate TonyL Excel Worksheet Functions 0 May 31st 05 12:19 AM
Edit query takes a long time TonyL Excel Worksheet Functions 0 May 11th 05 10:50 PM
Msgbox Wildman Excel Worksheet Functions 1 April 26th 05 04:57 AM


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