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

  • 2
    You might be able to see which line is causing issues - force an error on the first line of code in Workbook_Open(). Type a string, for example “x” as the first line of code in the Open event. Save and close the file. The next time you open it this will generate a compile error: “sub or function not defined”, and the Workbook_Open() line will be highlighted in yellow, in debug mode. Delete the string “x”, and now you’ll be able to step through the code line by line (F8) - it might show you the line that triggers the crash and maybe investigate further – paul bica Mar 28 '18 at 23:30
  • That was a great idea, Paul. But, it didn't work. Excel still shuts itself down when the file is opened. No error messages or pop-ups. – Russell Richter Mar 29 '18 at 18:15
  • Not sure what "shut down" means: it doesn't even get to Workbook_Open() event in debug mode? Does it just flash on the screen and then the "EXCEL.EXE" process doesn't appear in the Task Manager window? If so, does your user have any unusual add-ins loaded by default or Personal.xlsb (Personal Macro Workbook)? Do you see any error messages in Event Viewer - Application, Security, or System logs? – paul bica Mar 29 '18 at 23:03
  • "Shut down" means: Excel may be open with no workbooks loaded. He clicks File / Open, selects the .xlsb file, and clicks 'Open'. The file loads, and for a split second, you can see one of the worksheets. But, Excel instantly vanishes -- as if he had closed Excel with no workbooks open. Excel self-exits. It's not in the Task Manager window. He has no add-ins. But, I will check the Event Viewer -- I hadn't even thought to do that. Thanks! – Russell Richter Apr 4 '18 at 18:43
  • 1
    It looks like a McAfee issue. McAfee logs show: ExP:Write Blocked an attempt to exploit C:\PROGRAM FILES (X86)\MICROSOFT OFFICE\ROOT\OFFICE16\EXCEL.EXE, which targeted the LoadLibraryW API. – Russell Richter Apr 5 '18 at 17:02

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.