vba - Modeless UserForm won't allow user to change windows -


I have a script that revolves around 500 + files and is modest by using the process detection and method Edits if the string is not found, however, I would like to open the code as a modulated user which will allow manual editing. I have to execute a different subtitle after opening UserForm , but because I am using for each loop, I can not get out of the routine and then return .

The script works, except that when Save_User is opened, it behaves as if it was the model there were two windows open But I can not choose any of them, and the preview of each window is white in the taskbar. Why can it be any idea why this is happening?

  Option Public Public Distribution System, Workbook as Template Public Search. Select it as range, select as replacement, first Rowz as Range, Range of Range The second range, the static range () string as the public target, in the form of string public target, change the form of the form of the public search string as an integer Find as string, as string, replace text as string, public count as integer, has been updated as integer. Set as an object set file as an object dim file in the form of FSO object dim file. Set FSO = CreateObject ("Scripting.FileSystemObject") folder = FSO.GetFolder (FilePath) Count = 0 Updated = 0 in each file Folder.Files File.Type "Microsoft Excel *" then the application. Screen Updating = Wrong Set WB = Workbooks Open (file.php) search SELECT = WB.Worksheets ("Repair instructions"). Change Range ("K17: W40") Select Change = WB.Worksheets ("Repair instructions"). Range ("X17: AJ40") LastRow = WB.Worksheets ("Repair instructions"). Nge ("K40: W40"). End (xlUp) .row set target = find select. Find (FindText, LookAt: = xlWhole) If the target is nothing, then lastRow = 39 then Save_User.ValModeless Show Save_User.Visible DoEvents Wend GoTo next if the latestro mod 2 = 0 then WB.Worksheets ("Repair instructions"). Range ("K" & Lestero + 1, "W" & amp; Previous Line + 1) = Search Text WB.Worksheets ("Repair instructions") Range ("X" and last line + 1, "AJ" and last line + 1) = _ Add_User.txtFirst.Value WB.Worksheets ("Repair instructions"). ("X" and last line + 2, "AJ" and last line + 2) = _ Add_User.txtSecond.Value Else WB.Worksheets ("Repair instructions"). Range ("K" and "LastRow + 2", "W" and Landro + 2) = Search text WB.Worksheets ("Repair instructions"). Range ("X" and the last line + 2, "AJ" and the last line + 2) = _ Add_User.txtFirst.ValueWB worksheets ("Repair instructions"). Range ("X" and "Final" + 3, "AJ" and last line + 3) = _ Add_User.txtSecond.Value End If WB.Close True Updated = Updated + 1 End if set otherwise FirstRow = WB.Worksheets ("Repair instructions"). Range ("X" and "Target" line, "AJ" and Target. Line) Secondary set Do = WB.Worksheets ("do not repair Directions "). Range (" X "and target. Rao + 1," AJ "and Goal. Rau + 1) Firsta.val = Ad_Uzor.TestFest.Value Secondvar.val = Ad_User.Taxed ValueWB = Count + 1 Unload the next file Applyable_User Unload Add_User Unloading Ref_User Unload Replace_User MsgBox (updated & amp; "of" & amp; count & amp; "Files were updated.")   

Edit

David, thank you! I also do not believe that as a reason, I But I'm grateful that this is relatively simple! I do not know about any other work that cycling will hide Excel files, so I did the if statement with Save_User :

 If the lastRow = 39 then the application. Screen updating = True WB Activate Save_User. Activate Save_User. VbModeless Show Save_User.Visible DoEvents Wend app. The Cycling Excel window now appears for editing, but I can not really make any changes (my cursor is now a crosshairs, And I can not change my values ​​but I can select the cells). None of the workbooks should be preserved, is there anything that I am missing? Or maybe there is a better way to hide activity in the background (because I get 500+ files visible and do not disappear)?   

This is your culprit:

  Application.ScreenUpdating = False < / Code>  

This prevents user input.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -