03856me
Active Member
- Joined
- Apr 4, 2008
- Messages
- 297
I have workbooks that contain 100's of timesheets. The workbooks (20-30) all reside in the same folder. The payroll managers runs another report to pull the summary details from all the workbooks in the folder. 99% of the time there are no issues, but that 1% is causing the entire payroll upload from executing correctly. The problem is the same same code resides in all the workbooks. I have narrowed the issues down to the workbook_open event below. Suggestions on how to modify this code would be welcomed.
VBA Code:
Private Sub Workbook_Open() 'this code prevents duplicate file names in the Project Window
Application.DisplayAlerts = False
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
Workbooks.Open ThisWorkbook.FullName
ThisWorkbook.Close False
Set Application.ThisWorkbook = Nothing
Application.DisplayAlerts = True
End Sub