Hello,
At my work we have 20 team members who update a personal file on a daily basis. This is consolidated in 1 file which is copied to a dashboard file (all done by VBA). Since I noticed updating of links to other files works faster when these seperate personal files are opened, the VBA is designed to first open all these files and then the file with all the links. When running the VBA, especially on a slower internet connection, the VBA is willing to work faster then the opening of files is done. Even when I have given the ScreenUpdating=False command I still get a dialog with status of opening files and also on certain occassions the screen gets messed up during the execution. VBA still continues, but I'm guessing not efficient and also not in a smooth visual way.
Since this VBA is written to reduce time I rather not build a WAIT of one second per file opening.
Does anybody has a solution???
Code is as following:
Dim MyFolder As String
Dim MyFile As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
MyFolder = "F:\"
MyFile = Dir(MyFolder & "\*.xlsx")
Do While MyFile <> ""
Workbooks.Open Filename:=MyFolder & "\" & MyFile, UpdateLinks:=False
MyFile = Dir
Especially here screenupdating sort of turns on caused by slower opening of files
Loop
Workbooks.Open "F:\temp.<wbr>xlsb", UpdateLinks:=True
Especially here screenupdating sort of turns on caused by slower opening of files
Workbooks("tempa.xlsm").Worksheets("<wbr>Timewriting").Range("a4:<wbr>ajz1500").Value = Workbooks("<wbr>temp.<wbr>xlsb").Worksheets("<wbr>Timewriting").Range("a4:<wbr>ajz1500").Value
For Each wb In Application.Workbooks
If wb.Name <> ThisWorkbook.Name Then
wb.Close SaveChanges:=False
End If
At my work we have 20 team members who update a personal file on a daily basis. This is consolidated in 1 file which is copied to a dashboard file (all done by VBA). Since I noticed updating of links to other files works faster when these seperate personal files are opened, the VBA is designed to first open all these files and then the file with all the links. When running the VBA, especially on a slower internet connection, the VBA is willing to work faster then the opening of files is done. Even when I have given the ScreenUpdating=False command I still get a dialog with status of opening files and also on certain occassions the screen gets messed up during the execution. VBA still continues, but I'm guessing not efficient and also not in a smooth visual way.
Since this VBA is written to reduce time I rather not build a WAIT of one second per file opening.
Does anybody has a solution???
Code is as following:
Dim MyFolder As String
Dim MyFile As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
MyFolder = "F:\"
MyFile = Dir(MyFolder & "\*.xlsx")
Do While MyFile <> ""
Workbooks.Open Filename:=MyFolder & "\" & MyFile, UpdateLinks:=False
MyFile = Dir
Especially here screenupdating sort of turns on caused by slower opening of files
Loop
Workbooks.Open "F:\temp.<wbr>xlsb", UpdateLinks:=True
Especially here screenupdating sort of turns on caused by slower opening of files
Workbooks("tempa.xlsm").Worksheets("<wbr>Timewriting").Range("a4:<wbr>ajz1500").Value = Workbooks("<wbr>temp.<wbr>xlsb").Worksheets("<wbr>Timewriting").Range("a4:<wbr>ajz1500").Value
For Each wb In Application.Workbooks
If wb.Name <> ThisWorkbook.Name Then
wb.Close SaveChanges:=False
End If