PDA

View Full Version : ScreenUpdating = False doesn't seem to work



GreenMonkey
01-20-2011, 04:09 PM
I have some code that I'm using as an AutoOpen sub for what I'll call my "main" document. What I'd like it to do is to open a number of additional Word documents and then minimize all but the main document, but I want to do so without showing the user the process. Application.ScreenUpdating = False doesn't seem to work. Does anyone have any suggestions? Thanks! Here's a bit of the code:

Sub AutoOpen()

ActiveWindow.WindowState = wdWindowStateMaximize
Application.ScreenUpdating = False

Documents.Open ("H:\WORDTEXT\Templates\TAChecklistEPDocs.docm")
Documents.Open ("H:\WORDTEXT\Templates\TAChecklistFirstMeetingPrep.docm")
Documents.Open ("H:\WORDTEXT\Templates\TAChecklistBenePOA.docm")
Documents.Open ("H:\WORDTEXT\Templates\TAChecklistBringToMeeting.docm")
Documents.Open ("H:\WORDTEXT\Templates\TAChecklistCalendarDeadlines.docm")

Application.Windows("TAChecklistEPDocs.docm").WindowState = wdWindowStateMinimize
Application.Windows("TAChecklistFirstMeetingPrep.docm").WindowState = wdWindowStateMinimize
Application.Windows("TAChecklistBenePOA.docm").WindowState = wdWindowStateMinimize
Application.Windows("TAChecklistBringToMeeting.docm").WindowState = wdWindowStateMinimize
Application.Windows("TAChecklistCalendarDeadlines.docm").WindowState = wdWindowStateMinimize

Application.ScreenUpdating = True

End Sub

Tinbendr
01-21-2011, 06:01 AM
Does anyone have any suggestions?
Documents.Open "H:\WORDTEXT\Templates\TAChecklistEPDocs.docm", Visible:=False

Screen updating is not bulletproof either.

David

GreenMonkey
01-21-2011, 01:54 PM
Perfect!!! Thanks, David!

Paul_Hossler
01-22-2011, 03:07 PM
Visible:=False


Yes, thanks -- I didn't know about that either

Paul

fumei
01-24-2011, 09:53 AM
Please, I am not being critical. It is a good practice when putting objects/methods/properties in the VBE to hit the Ctrl-Spacebar to get other parameters. In fact, with Option Explicit on as soon as you put:

Documents.Open <space>

you should get:

Filename, [Confirm Conversions],[ReadOnly],[AddToRecentFiles],[PasswordDocument],[PasswordTemplate],[Revert],[WritePasswordDocument],[WritePasswordTemplate],[Format],[Encoding],[Visible],[OpenAndRepair],[DocumentDirection],[NoEncodingDialog]

as a pop up. These are, depending on version, all the available parameters for any object/method/property.

This is a great tool to get some ideas of what goes with what.

Just a suggestion.