I have a VBA script that adds sheets to around 500 excel files. I had no problems running the VBA script and adding simple sheets, but when I try to add a sheet with VBA scr
So, some tips for you:
1st. (according to comment)
Add as a first line to your sub: Application.ScreenUpdating = false and add the other line right before End Sub : Application.ScreenUpdating = true
2nd. Move this line (it's setting constance reference):
Set wb = Workbooks("Equipment Further Documentation List.xls")
before:
Do Until txtStream.AtEndOfStream
3rd is just a tip.
To see the progress of your sub add the following line:
Application.StatusBar = file.Name
after this line:
Workbooks.Open strNextLine & Application.PathSeparator & file.Name
Before the End Sub add additionally this code:
Application.StatusBar = false
As a result you can see in Excel app, in the status bar, file name which is currently in process.
Keep in mind that working with 500 files must be time-consuming.