This tends to be when the template being copied opens/closes. In some respects, the flickering can be nice-- it lets you know something is going on.Is there anything that I can add to my code that might eliminate the updating? Would it help it the above was placed in the template that is being opened ? Screen Updating controls the updating of the current document's window, but not the updating that occurs when documents are opened/closed. If your screen "locks up" because of an effective use of the Application. As you can read: starting in cell A1 a value of "99" will be entered in the selected cell then the cursor will move one cell down to enter "99", repeat the process until the row number of the selected cell is 3000 and come back to cell A1.Hi all, Before I start, I will admit I posted this in a forum that helps me a lot with another Office product, but as of this post they were not able to shed any light on this issue. The following does that for the first instance of the found text (matching the case). Caption = "Processing document " & i - 1 & " of " & doc To Open. Count End If 'Open each document Set Doc = Documents. Selected Items(i), _ Visible:=False, _ Addto Recent Files:=False) Set rng To Search = Doc. Screen Updating = True Msg Box "Processing complete" End If lbl_Exit: Set Doc = Nothing Set doc To Open = Nothing Set rng To Search = Nothing Exit Sub Err_Exit: Msg Box Err. It appears that you want to locate the text "Discharge Pack" and insert a paragraph break after it and write the text to the start of that new paragraph. Execute(Find Text:=str Text To Find, Match Case:=True) rng To Search. Close Save Changes:=wd Save Changes Do Events Next Unload o Frm Application.
Dim str VARIABLE1 As String If Opt1 = True Then str VARIABLE1 = Word. especially if the OP gets to the point where so many documents are being opened/closed in the background that the screen is actually frozen for a noticeably long time. You just have to set the range you have defined to the place where the text is to be inserted. Collapse 0 Exit Do 'If you only want to process the first instance Loop End With Doc. Thank you for the progress indicator code and the tip on how to do this better and, I am always keen to learn new things if it will help me in life. The following code has been adjusted to use that progress bar. It is neither necessary nor desirable to write a text string to the clipboard in order to write it to the document. As you will no doubt gathered I am a novice at VBA and this attempt was just trying to emulate what I would do manually. Sorry to be a pain macropod but would you mind showing how the 'Insert File' method works and a code for it based on the above? - Neil I think Paul was asking whether there are scenarios where you need to open/copy/close/paste from multiple documents, not whether you might have multiple option buttons selected at once (in which case, I would suggest a use of the collection object, but it doesn't appear to be a need for you) The performance hits are the (primarily) the following: 1. Insert File might be helpful, although I don't think it will be appreciably different from opening with . Copy Making the Visible parameter false in the Documents. One of those commands tells Word to give some visual feedback to the end-user (i.e., highlight stuff in black) and one just does it (that's the concept of *the* Selection vs. You'll want to keep looking for any use of a selection object in your code, and then post sample for how to translate (I'm guessing it's rampant, since at least some of this started as a recorded macro-- which is a great way to start, very easy to remember what you did and see the recorded equivalent). Open("E:\MYDOCUMENT" & Str Var & ".dot", _ Add To Recent Files:=False, Visible:=False) Doc. Option 1 - Statement 1 Option 2 - Statement 2 Option 3 - Statement 3" When using Option Buttons in a Frame you can only select one Option Button at a time I have found.
Search for screen updating:
Also, if you are opening multiple documents without user interaction, you might try opening them with the optional Visible argument set to false. However, in my experience, asking this question generally means (with respect), that you would probably benefit from a revamp of your code, rather than bracketing all your subroutines with some way of hiding your actual processing. However, in my experience, asking this question generally means (with respect), that you would probably benefit from a revamp of your code, rather than bracketing all your subroutines with some way of hiding your actual processing. Screen Updating = True' in a called subroutine invariably means you're causing the screen to flicker at that point if any ranges before the end of the visible range have been expanded/contracted or anything on screen has had its formatting changed. Below is an example of the code I am using, sorry, for security reasons I can't put in the actual code, but this is the basics. With the code you posted, that was certainly the case.