Macro stops with "System error" and "Automation error" after looping through open workbooks in current folder

Hello Experts,
CreateSummary macro routine properly loops through all open workbooks and their worksheets in the current folder.  However, it then stops without processing two called sub routines. An error dialog "System error" followed by long string of numbers appears and requires pressing the "Ok" button to free the cursor.  Occasionally, the "System error" dialog includes a second line stating "Automation error"
Attached file has screen clips of the error and a restatement of what happens and unsuccessful attempts to resolve the :System error".


Thanks in advance,
Berry MetzgerLean process improvement consultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Make the following changes in your code and see if it is executed without an error.
Swb.Close False should be just after the Next ws in the code, while at present it is placed after End If statement.

    Next ws
    Swb.Close False
End If
Next fil

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Berry MetzgerLean process improvement consultantAuthor Commented:
Thank you sktneer, you nailed it!  This macro accomplishes a lot of clerical work in Excel in just seconds. You and Saurabh Singh Teotia have done a fantastic job with these two macros.
Great job to both of you.
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Berry! Glad I could help.
Berry MetzgerLean process improvement consultantAuthor Commented:
Oops, I spoke too soon.  
The  macro ran several times, looping through 10 workbooks, OK.
I modified screen refreshing to show results before a message box appears stating the macro completed.  Since then, it stopped creating the summary after looping through ten workbooks.  I will open a new thread to request ideas to fix it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.