An implementation of Visual Basic that is built into Microsoft products.
Excel 2611 closes unexpectedly during repeated VBA report generation — 0xC0000005 execute access violation
Dear Microsoft Excel Support Team,
I am investigating an intermittent crash in 64-bit Excel. After several successful PDF exports from a macro-enabled workbook, selecting the same report control can cause the entire Excel process to close without a VBA error message. After restarting Excel, the same report can succeed with the same data.
The entire workflow I tested worked normally in Excel Safe Mode. I completed 40 report attempts while repeatedly closing and reopening the workbook within the same Excel process. In normal mode, I explicitly set Office to disable hardware graphics acceleration and verified the setting. Excel still closed during the 23rd report attempt.
I would appreciate help understanding which difference between Safe Mode and normal mode could explain this behavior, and whether the findings below match a known Excel/VBA issue.
Environment and previous testing
The affected computer runs Windows 11 26H2, build 26300.10075. I captured crashes on two 64-bit Excel 2611 builds, 16.0.20625.20108 and 16.0.20625.20142. The VBA runtime version in the full-memory dump was 7.1.11.58.
I previously completed 100 functional tests on the same computer using my usual test procedure, without observing an Excel crash. Between that series and the recent tests, I made no deliberate changes to the computer’s configuration and installed no additional software or Excel add-ins. I did not record the exact Office build, workbook revision, or number of reports generated in a single Excel session during the earlier series, so I cannot establish whether Office updated automatically in the meantime.
How the workbook and calculation engine work
The application runs locally from USB. It consists of an .xlsm workbook and a native 64-bit C++ calculation DLL distributed alongside it.
- Calculation: VBA reads worksheet data and passes it to the DLL through
Declare PtrSafefunction declarations. The DLL performs regression calculations and model comparisons. VBA polls the calculation job, retrieves the results, writes them to the workbook, and releases the job handle. - DLL lifetime: The DLL loads directly into
EXCEL.EXEand requires no Excel or COM add-in registration. In the diagnostic build, it stays loaded while the Excel process remains open. During the latest affected session, the trace recorded one initial DLL load and seven successful reuses across eight workbook opens. - Report generation: Selecting the PDF control on the dashboard invokes a VBA
Worksheet_SelectionChangehandler. The report routine recalculates the workbook, validates the model, and checks the native engine’s availability and interface version. VBA then uses the Excel object model to create a temporary workbook, populate report sheets, embed chart images, configurePageSetup, and export the PDF usingExportAsFixedFormat.
Safe Mode comparison and configuration checks
In both modes, I used the same report control and repeatedly closed and reopened the workbook while keeping Excel running.
- Safe Mode (
excel /safe): All 40 report attempts returned without Excel closing. - Normal mode: 22 reports were saved successfully. Excel closed during the 23rd attempt, the first export after the eighth workbook open in that process.
- Add-ins and startup files: Excel showed no active application add-ins. All three listed COM add-ins were unchecked. Both the user and Office installation
XLSTARTfolders were empty, and the alternate startup folder setting was blank. - Graphics acceleration: Before the normal-mode test, I set
HKCU\Software\Microsoft\Office\16.0\Common\Graphics\DisableHardwareAccelerationtoREG_DWORD 1and verified the value withreg query. The crash recurred. I verified the Office preference but did not independently capture which rendering path Excel used.
WinDbg findings
Two earlier crash dumps recorded an unhandled 0xC0000005 execute access violation. I examined the exception record, register context, call stack, memory protection, heap allocation, and instructions at the execution target. The full-memory dump, captured with Sysinternals ProcDump, showed the following:
-
.exr -1reportedParameter[0] = 8andParameter[1] = 0x0000015B06E77BC8. The instruction pointer was at that same address. -
!addressclassified the target as heap memory with stateMEM_COMMIT, typeMEM_PRIVATE, and protectionPAGE_READWRITE. -
!heap -xplaced the target 88 bytes inside a 560-byte block markedLFH Allocated, beginning at0x0000015B06E77B70. - Disassembly showed a reference to
VBE7!g_PPExSP. The call stack includedVBE7!EpiInvokeMethodandVBE7!EVENT_SINK_Invoke. - WinDbg reported the failure bucket
SOFTWARE_NX_FAULT_INVALID_POINTER_EXECUTE_c0000005_VBE7.DLL!g_EbThread.
The same 86-byte instruction sequence appeared at the execution target in both dumps. From the first instruction through ret, the bytes matched apart from the embedded address referencing VBE7.DLL in each process. The full-memory dump establishes the page protection at the time of the exception. I do not have a trace showing whether the page was previously executable or which component set its protection.
What happened during the latest crash
I matched the Windows Application event to the workbook trace using process ID 0x1904 (6404). On November 29, the 23rd report started at 15:25:18 local time. Workbook recalculation, model validation, and the native-context check all returned. Excel then created the temporary report workbook and embedded the chart.
At 15:25:25, the macro had finished populating and formatting a data appendix containing 72 rows and five columns. The final marker was DATA ANNEX PAGE SETUP BEGIN. The corresponding END marker was absent. Between those markers, one VBA routine sets Application.PrintCommunication = True, activates the worksheet, and configures paper size, orientation, scaling, and margins. The trace does not distinguish the individual operations inside that routine. The Save dialog and ExportAsFixedFormat had not yet been reached.
Three earlier reports in the same process completed this step with an appendix of the same dimensions. During a separate crash, the trace stopped earlier, while the main report content was being built. The available logs therefore do not identify a single VBA statement common to all failures.
Exact Windows Application log entry for the latest incident
The original event text is in German. No new dump was generated for this incident, so its access-violation subtype remains unknown.
Fehlerhafter Anwendungsname: EXCEL.EXE, Version: 16.0.20625.20142, Zeitstempel: 0x6b040f8d
Fehlerhafter Modulname: unknown, Version: 0.0.0.0, Zeitstempel: 0x00000000
Ausnahmecode: 0xc0000005
Fehleroffset: 0x00000241c17989b8
Fehlerhafte Prozess-ID: 0x1904
Fehlerhafte Anwendungsstartzeit: 0x1DD8008FE5D6868
Fehlerhafter Anwendungspfad: C:\Program Files\Microsoft Office\Root\Office16\EXCEL.EXE
Fehlerhafter Modulpfad: unknown
Berichts-ID: 5678fbb8-14f5-4ad1-9bb2-e3add255e11f
Vollständiger Name des fehlerhaften Pakets:
Fehlerhafte paketbezogene Anwendungs-ID:
Questions for the Excel/VBA engineering team
- Given the add-in, startup-folder, and graphics checks above, which differences between Safe Mode and normal mode would you investigate first? Is there a supported way to isolate them individually?
- Does the repeated instruction sequence referencing
VBE7!g_PPExSPon aPAGE_READWRITEheap page match a known issue? Is there a supported fix or workaround? - Are there known issues involving repeated workbook opens within the same Excel process when VBA calls a native DLL that remains loaded across those opens?
- What specific trace should I capture during the next session to determine how the target block acquired its protection and why execution was directed to it? What evidence would help distinguish a VBA runtime issue from an earlier memory error in the calculation DLL or another in-process component?
I can provide the crash dumps, WinDbg output, and timestamped application trace through a private Microsoft support channel.
Kind regards,Dear Microsoft Excel Support Team,
I am investigating an intermittent crash in 64-bit Excel. After several successful PDF exports from a macro-enabled workbook, selecting the same report control can cause the entire Excel process to close without a VBA error message. After restarting Excel, the same report can succeed with the same data.
The entire workflow I tested worked normally in Excel Safe Mode. I completed 40 report attempts while repeatedly closing and reopening the workbook within the same Excel process. In normal mode, I explicitly set Office to disable hardware graphics acceleration and verified the setting. Excel still closed during the 23rd report attempt.
I would appreciate help understanding which difference between Safe Mode and normal mode could explain this behavior, and whether the findings below match a known Excel/VBA issue.
Environment and previous testing
The affected computer runs Windows 11 26H2, build 26300.10075. I captured crashes on two 64-bit Excel 2611 builds, 16.0.20625.20108 and 16.0.20625.20142. The VBA runtime version in the full-memory dump was 7.1.11.58.
I previously completed 100 functional tests on the same computer using my usual test procedure, without observing an Excel crash. Between that series and the recent tests, I made no deliberate changes to the computer’s configuration and installed no additional software or Excel add-ins. I did not record the exact Office build, workbook revision, or number of reports generated in a single Excel session during the earlier series, so I cannot establish whether Office updated automatically in the meantime.
How the workbook and calculation engine work
The application runs locally from USB. It consists of an .xlsm workbook and a native 64-bit C++ calculation DLL distributed alongside it.
- Calculation: VBA reads worksheet data and passes it to the DLL through
Declare PtrSafefunction declarations. The DLL performs regression calculations and model comparisons. VBA polls the calculation job, retrieves the results, writes them to the workbook, and releases the job handle. - DLL lifetime: The DLL loads directly into
EXCEL.EXEand requires no Excel or COM add-in registration. In the diagnostic build, it stays loaded while the Excel process remains open. During the latest affected session, the trace recorded one initial DLL load and seven successful reuses across eight workbook opens. - Report generation: Selecting the PDF control on the dashboard invokes a VBA
Worksheet_SelectionChangehandler. The report routine recalculates the workbook, validates the model, and checks the native engine’s availability and interface version. VBA then uses the Excel object model to create a temporary workbook, populate report sheets, embed chart images, configurePageSetup, and export the PDF usingExportAsFixedFormat.
Safe Mode comparison and configuration checks
In both modes, I used the same report control and repeatedly closed and reopened the workbook while keeping Excel running.
- Safe Mode (
excel /safe): All 40 report attempts returned without Excel closing. - Normal mode: 22 reports were saved successfully. Excel closed during the 23rd attempt, the first export after the eighth workbook open in that process.
- Add-ins and startup files: Excel showed no active application add-ins. All three listed COM add-ins were unchecked. Both the user and Office installation
XLSTARTfolders were empty, and the alternate startup folder setting was blank. - Graphics acceleration: Before the normal-mode test, I set
HKCU\Software\Microsoft\Office\16.0\Common\Graphics\DisableHardwareAccelerationtoREG_DWORD 1and verified the value withreg query. The crash recurred. I verified the Office preference but did not independently capture which rendering path Excel used.
WinDbg findings
Two earlier crash dumps recorded an unhandled 0xC0000005 execute access violation. I examined the exception record, register context, call stack, memory protection, heap allocation, and instructions at the execution target. The full-memory dump, captured with Sysinternals ProcDump, showed the following:
-
.exr -1reportedParameter[0] = 8andParameter[1] = 0x0000015B06E77BC8. The instruction pointer was at that same address. -
!addressclassified the target as heap memory with stateMEM_COMMIT, typeMEM_PRIVATE, and protectionPAGE_READWRITE. -
!heap -xplaced the target 88 bytes inside a 560-byte block markedLFH Allocated, beginning at0x0000015B06E77B70. - Disassembly showed a reference to
VBE7!g_PPExSP. The call stack includedVBE7!EpiInvokeMethodandVBE7!EVENT_SINK_Invoke. - WinDbg reported the failure bucket
SOFTWARE_NX_FAULT_INVALID_POINTER_EXECUTE_c0000005_VBE7.DLL!g_EbThread.
The same 86-byte instruction sequence appeared at the execution target in both dumps. From the first instruction through ret, the bytes matched apart from the embedded address referencing VBE7.DLL in each process. The full-memory dump establishes the page protection at the time of the exception. I do not have a trace showing whether the page was previously executable or which component set its protection.
What happened during the latest crash
I matched the Windows Application event to the workbook trace using process ID 0x1904 (6404). On November 29, the 23rd report started at 15:25:18 local time. Workbook recalculation, model validation, and the native-context check all returned. Excel then created the temporary report workbook and embedded the chart.
At 15:25:25, the macro had finished populating and formatting a data appendix containing 72 rows and five columns. The final marker was DATA ANNEX PAGE SETUP BEGIN. The corresponding END marker was absent. Between those markers, one VBA routine sets Application.PrintCommunication = True, activates the worksheet, and configures paper size, orientation, scaling, and margins. The trace does not distinguish the individual operations inside that routine. The Save dialog and ExportAsFixedFormat had not yet been reached.
Three earlier reports in the same process completed this step with an appendix of the same dimensions. During a separate crash, the trace stopped earlier, while the main report content was being built. The available logs therefore do not identify a single VBA statement common to all failures.
Exact Windows Application log entry for the latest incident
The original event text is in German. No new dump was generated for this incident, so its access-violation subtype remains unknown.
Fehlerhafter Anwendungsname: EXCEL.EXE, Version: 16.0.20625.20142, Zeitstempel: 0x6b040f8d
Fehlerhafter Modulname: unknown, Version: 0.0.0.0, Zeitstempel: 0x00000000
Ausnahmecode: 0xc0000005
Fehleroffset: 0x00000241c17989b8
Fehlerhafte Prozess-ID: 0x1904
Fehlerhafte Anwendungsstartzeit: 0x1DD8008FE5D6868
Fehlerhafter Anwendungspfad: C:\Program Files\Microsoft Office\Root\Office16\EXCEL.EXE
Fehlerhafter Modulpfad: unknown
Berichts-ID: 5678fbb8-14f5-4ad1-9bb2-e3add255e11f
Vollständiger Name des fehlerhaften Pakets:
Fehlerhafte paketbezogene Anwendungs-ID:
Questions for the Excel/VBA engineering team
- Given the add-in, startup-folder, and graphics checks above, which differences between Safe Mode and normal mode would you investigate first? Is there a supported way to isolate them individually?
- Does the repeated instruction sequence referencing
VBE7!g_PPExSPon aPAGE_READWRITEheap page match a known issue? Is there a supported fix or workaround? - Are there known issues involving repeated workbook opens within the same Excel process when VBA calls a native DLL that remains loaded across those opens?
- What specific trace should I capture during the next session to determine how the target block acquired its protection and why execution was directed to it? What evidence would help distinguish a VBA runtime issue from an earlier memory error in the calculation DLL or another in-process component?
I can provide the crash dumps, WinDbg output, and timestamped application trace through a private Microsoft support channel.
Kind regards,
Michael