I created a VBA to generate multiple monthly reports. This VBA copies worksheets from four source files to a skeleton file and generates reports from the skeleton. The skeleton file contains report templates and the VBA to populate the templates for a facility or for the facilities combined. When other users from multiple sites run the program, it executes in 45-60 seconds. When I run it (same file in same location), it takes almost 5 minutes. There must be something different about my machine.
I found the delay in processing to be this Statement:
I open a source file then copy a worksheet from the source to the skeleton file. I do this 4 times. Each copy takes about a minute.
When I run the VBA in Safe Mode, it runs quickly, 40-50 seconds. This led me to believe that an add-in contributed to the poor performance. I removed ALL the add-ins. Without any add-ins, in regular mode, the VBA still takes 5 minutes to run, in safe mode without add-ins, 40-50 seconds.
What is interfering with the worksheet copy on my machine?
Where else can I look to remove the obstacle?
Got any suggestions?
Thanks for your help,
Glenn
I found the delay in processing to be this Statement:
Code:
Workbooks(CurrFile).Sheets(FacilityName).Copy After:=Workbooks(Skeleton).Sheets(Workbooks(Skeleton).Sheets.Count)
I open a source file then copy a worksheet from the source to the skeleton file. I do this 4 times. Each copy takes about a minute.
When I run the VBA in Safe Mode, it runs quickly, 40-50 seconds. This led me to believe that an add-in contributed to the poor performance. I removed ALL the add-ins. Without any add-ins, in regular mode, the VBA still takes 5 minutes to run, in safe mode without add-ins, 40-50 seconds.
What is interfering with the worksheet copy on my machine?
Where else can I look to remove the obstacle?
Got any suggestions?
Thanks for your help,
Glenn