Excel 2016 workbook with VBA shuts down immediately after opening it

I built an Excel workbook (CPD.xlsb for reference). It has extensive VBA programming, including code that executes when the file is opened (Private Sub Workbook_Open() etc.).

The workbook has been deployed to nearly 70 users who have been running it for 8 months. In that time, it has run on some combination of Windows 7 or 10, 32-bit or 64-bit, and Office 2013 / 2016 (a.k.a. 365 ProPlus). Nearly all of the users are now on Win10/Excel2016, and it works on all of the OS/Office combinations, in 7 countries, on 4 continents . . .

. . . except for one guy. (There's always one, right?)

He has Win10/Excel2016 like most of us. He can run other VBA-laden Excel workbooks that I have built without a problem. But, whenever he opens this CPD.xlsb file, Excel immediately shuts down. When we restart it, Excel wants to start in Safe Mode, which we do. And, after a normal shutdown/restart, Excel opens fine. But, the CPD.xlsb will cause Excel to close every time we try to open it.

There are no pop-ups or warnings or explanations of what happened. Excel just quits.

There isn't even time to Ctrl+Break to interrupt the code before Excel shuts down.

With almost 70 other users not having any problems, I can't imagine it's a programming issue.

* I compared his Excel settings (File / Options) to mine, and they match exactly.

* I have given him a brand new copy of CPD.xlsb and put it in a different folder, and it crashes.

* I did the Quick Fix on MS Office 365 Pro Plus, and it still crashes.

* I did the Online Repair for MS Office 365 Pro Plus, and it still crashes.

* I sent him a different workbook with a simple Workbook_Open() routine that pops up a MsgBox, and it works fine.

Help! What am I missing? What would make this one PC shut down Excel the moment the file is opened?

Thanks for any suggestions! Russell
Russell RichterBusiness Operations ManagerAsked:
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.

Ejgil HedegaardCommented:
You could make a version with a msgbox, or just a Stop command in the workbook open event as the first line, so you have the possibility to step the macro and see where it quit.
Russell RichterBusiness Operations ManagerAuthor Commented:
Thanks, Ejgil.  I tried putting 'Stop' as the first line in Workbook_Open().  Excel still shuts down before getting that far.
Ejgil HedegaardCommented:
Guess something happens in the compiling process when opening.
Turn off macros in the security setting (disable with warning), then it should be possible to open the workbook.
Then compile, and see if that works.
Check for missing references.
Copy the open event code to a new workbook, and see if is possible to step the code.

Perhaps Office has to be reinstalled, not just repaired.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Russell RichterBusiness Operations ManagerAuthor Commented:
It looks like McAfee is the culprit:  
ExP:Write Blocked an attempt to exploit C:\PROGRAM FILES (X86)\MICROSOFT OFFICE\ROOT\OFFICE16\EXCEL.EXE, which targeted the LoadLibraryW API.
Russell RichterBusiness Operations ManagerAuthor Commented:
Answer:  McAfee Endpoint Security was shutting down Excel when this Excel file was opened.  He had to disable Threat Prevention in order to get this to work.  Interestingly, there are 4 users out of 70 who have had to do this.  The others are not affected by MES.

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
Ejgil HedegaardCommented:
Good you found a solution.
Not excellent, but it works.
Russell RichterBusiness Operations ManagerAuthor Commented:
Thanks for the good suggestions.
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

From novice to tech pro — start learning today.