Word vba screen updating

o Story is a range of values for updating the formfields in a document Please view code, What happens is Update() is called at the beginning, it asks to input a title, the title is updated for the formfields in the current document ie. What happens next is that Call Sheet Print Out is called which takes the current document file name, searches an excel spreadsheet for the document file name value, then offsets and creates a list called forms of the offsetted value Ex FNList. Once the forms are opened the formfields are then updated and the forms are printed off. Sub Update() Dim Title As String Dim frm Title As User Form1 Dim o Story As Range Application.

These forms are then opened in word like so Set b Doc = Documents. What happens though is that the screenupdating works for the excel part, it then when it gets to word for opening the forms, shows opening the forms and a message appears on the status bar, stating word is updating fields in the current document. Screen Updating = False Set frm Title = New User Form1 With frm Title .

word vba screen updating-16

While Excel will set this back to True whenever focus is passed back to Excel (your macro finishes) in most cases, it pays to play it safe and include the code at the end.

You may even find in some cases that Screen Updating is set back to true before your recorded macro completes.

This can mean that what should take a matter of 1 to 3 seconds, often takes a lot longer.

Free Excel Help One drawback with recorded macros in Excel is that the code produced is often very inefficient.

This can happen with recorded macros that have the word Select used frequently.

If this does happen, you may need to repeat the line: Application.

For instance, any keys pressed while a function is running will be sent by Do Events The keyboard input will be processed before the screen is updated, so if you are changing cells on a spreadsheet by holding down one of the arrow keys on the keyboard, then the cell change event will keep firing before the main function finishes.

A User Form will not be refreshed in some cases, because Do Events will fire the events; however, Repaint will update the User Form and the user will see the changes on the screen even when another event immediately follows the previous event.

If this is the case, you could insert the following code at the front of your sub: I've found that this often speeds up whatever code I'm working with so much that having to alert the user to the progress is unnecessary.

It's just an idea for you to try, and its effectiveness is pretty dependent on your sheet and calculations.

By setting Screen Updating to False at the Start of the macro, you will not only stop the constant screen flickering associated with recorded macro, but also greatly speed up the execution of the macro.