Share via


Excel 64-bit crashes when activating macros but Excel 32-bit does not

Question

Monday, January 30, 2017 1:14 PM

Hi all,

I don't know if I'm correct here but I'm dealing with a really strange issue regarding Excel and VBA and a friend of mine recommended this forum to post the question.

So, as the title says, at my work, we have a customer, which works a lot with Excel and macros. Most of the time, they have no issues, but about every half a year, suddenly some of the files don't work anymore as soon as they open them. Excel either crashes already during the process of opening the file or it crashes after displaying a message with the content "Project or Libary not found".

We investigated and tried out different setups and tests. Here are our results so far with three documents the customer sent us:

  •  We can reproduce their issues on a virtual windows 10 machine with office 2013 64-bit, but not on any machine with Office 2013 32-bit nor Office 2016 32-bit.
  • As soon as a crash occurs, the event log lists an entry with the source “Application Error”, the error code “0xc0000005” and the faulting module “VBE7.DLL”
  • One of the employees of our customer said, if a crash happens, they can recompile the VB-code in it to get the worksheet working again. Half a year later, they will be guaranteed another crash, which can be solved by recompiling the project again.
  • We used an add-in, which shall clean-up the macro cache of a file. After we applied this script (which is listed at the bottom of the page), the three test files were all about 70 KB smaller than before and we were able to open them again without any crashes or error messages.

I reasearched more about this "cleanup-process" the Add-In is doing and I found an explanation about VB behaviour of compiling and decompiling code. This basically explains to me why the issue only occurs about every half a year, but not really, why this causes application crashes with Excel 64-bit, but not with Excel 32-bit.

So, my question: Does anyone now if Excel 64-bit is more delicate than Excel 32-bit regarding this compiled code? Is there anything to do to avoid those issues beside a cleanup tool?

Many thanks to everyone who has look into this question.

Kind regards, Andy

All replies (3)

Friday, February 3, 2017 6:54 AM

Hi,

Could you share us a sample file and your reproduce steps, we could try to reproduce.

Does "recompile the VB-code" refer to VBE->Debug->Compile VBA Project?

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


Tuesday, April 17, 2018 8:28 PM | 1 vote

We had the same exact issue:

Problem signature:

  Problem Event Name:                        APPCRASH

  Application Name:                             EXCEL.EXE

  Application Version:                           16.0.8431.2215

  Application Timestamp:                     5a745cd2

  Fault Module Name:                          VBE7.DLL

  Fault Module Version:                       0.0.0.0

  Fault Module Timestamp:                 59bae6d1

  Exception Code:                                  c0000005

  Exception Offset:                                00000000000f5b82

  OS Version:                                          6.1.7601.2.1.0.256.48

  Locale ID:                                             1033

Files containing macros and that linked to other worksheets crashed Excel in vbe7.dll.

We were able to fix the issue by following these MS articles:

https://support.microsoft.com/en-us/help/3085435/august-8-2017-update-for-excel-2016-kb3085435

 

https://blogs.technet.microsoft.com/the_microsoft_excel_support_team_blog/2012/09/07/excel-crashes-in-vbe7-dll-running-or-enabling-macro/

The following registry changes were needed:

HKEY_CURRENT_USER\Software\Microsoft\VBA\7.0\Common Type:  DWORD Name:  CompileOnDemand Value:  0

  • Locate and then select the following registry subkey: HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Excel\Options\

On the Edit menu, point to New, and then click DWORD Value.

Type ForceVBALoadFromSource, and then press Enter.

In the Details pane, right-click ForceVBALoadFromSource, and then click Modify.

In the Value data box, type 1, and then click OK.

You can perform the same changes by running these 3 commands:

Reg.exe add "HKCU\Software\Microsoft\Office\16.0\Excel\Options" /v "ForceVBALoadFromSource" /t REG_DWORD /d "1" /f

Reg.exe add "HKCU\Software\Microsoft\VBA\7.0\Common" /v "CompileOnDemand" /t REG_DWORD /d "0" /f

Reg.exe add "HKCU\Software\Microsoft\VBA\7.1\Common" /v "CompileOnDemand" /t REG_DWORD /d "0" /f


Monday, August 5, 2019 12:30 PM

Thank you very much Michael, after a long time with problems your answer has given us the solution, I don't have enough words to thank you for sharing it.