Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SendKeys and Application.ScreenUpdating
I have a module in which I'm using SendKeys to change a printer
property. At the beginning of the module, I have Application.ScreenUpdating = False so hide the various dialog boxes that open and close during the process. The problem is that the ScreenUpdating command looks to be ignored as I can see everything that is happening. Any help is appreciated. TIA, Mike. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
SendKeys and Application.ScreenUpdating
What you can do is use API calls to freeze the screen. This freezes the
screen better, but has the drawback that if something goes wrong you are stuck with a frozen screen and have to come out with Ctrl + Alt + Del. Also you have to unfreeze the screen before for example a MsgBox. Put this in the declarations (top of the module): Private Declare Function LockWindowUpdate Lib "USER32" (ByVal hwndLock As Long) As Long Private Declare Function GetDesktopWindow Lib "USER32" () As Long Then put this Sub somewhere in your module: Sub WindowUpdating(Enabled As Boolean) 'Completely Locks the Whole Application Screen Area, including dialogs and the mouse. Dim Res As Long If Enabled Then LockWindowUpdate 0 'Unlock screen area Else Res = LockWindowUpdate(GetDesktopWindow) 'Lock at desktop level End If End Sub Then use it in your code like this: WindowUpdating (False) 'to freeze the screen or: WindowUpdating (True) 'to unfreeze the screen RBS "Michael Malinsky" wrote in message oups.com... I have a module in which I'm using SendKeys to change a printer property. At the beginning of the module, I have Application.ScreenUpdating = False so hide the various dialog boxes that open and close during the process. The problem is that the ScreenUpdating command looks to be ignored as I can see everything that is happening. Any help is appreciated. TIA, Mike. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
SendKeys and Application.ScreenUpdating
"Michael Malinsky" wrote in message oups.com... I have a module in which I'm using SendKeys to change a printer property. At the beginning of the module, I have Application.ScreenUpdating = False so hide the various dialog boxes that open and close during the process. The problem is that the ScreenUpdating command looks to be ignored as I can see everything that is happening. Any help is appreciated. TIA, Mike. Application.ScreenUpdating = False will only prevent the cells from showing updated values. /Fredrik |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
SendKeys and Application.ScreenUpdating
I tried your suggestion, but I can still see the all of the print
dialogs pop up from the SendKeys commands. If I step through it, the desktop freezes, but when I run the module, it doesn't seem to work. Any ideas on what I'm missing? Thanks, Mike. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Application.ScreenUpdating problem | Excel Programming | |||
Question on application.screenupdating | Excel Programming | |||
problem with Application.ScreenUpdating | Excel Programming | |||
Application.ScreenUpdating malfunction | Excel Programming | |||
Application.ScreenUpdating = False | Excel Programming |