Excel 2611 closes unexpectedly during repeated VBA report generation — 0xC0000005 execute access violation

Michal Studzizur 0 Reputation points
2026-11-29T14:45:41.05+00:00

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 PtrSafe function 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.EXE and 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_SelectionChange handler. 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, configure PageSetup, and export the PDF using ExportAsFixedFormat.

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 XLSTART folders 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\DisableHardwareAcceleration to REG_DWORD 1 and verified the value with reg 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 -1 reported Parameter[0] = 8 and Parameter[1] = 0x0000015B06E77BC8. The instruction pointer was at that same address.
  • !address classified the target as heap memory with state MEM_COMMIT, type MEM_PRIVATE, and protection PAGE_READWRITE.
  • !heap -x placed the target 88 bytes inside a 560-byte block marked LFH Allocated, beginning at 0x0000015B06E77B70.
  • Disassembly showed a reference to VBE7!g_PPExSP. The call stack included VBE7!EpiInvokeMethod and VBE7!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

  1. 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?
  2. Does the repeated instruction sequence referencing VBE7!g_PPExSP on a PAGE_READWRITE heap page match a known issue? Is there a supported fix or workaround?
  3. 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?
  4. 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 PtrSafe function 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.EXE and 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_SelectionChange handler. 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, configure PageSetup, and export the PDF using ExportAsFixedFormat.

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 XLSTART folders 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\DisableHardwareAcceleration to REG_DWORD 1 and verified the value with reg 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 -1 reported Parameter[0] = 8 and Parameter[1] = 0x0000015B06E77BC8. The instruction pointer was at that same address.
  • !address classified the target as heap memory with state MEM_COMMIT, type MEM_PRIVATE, and protection PAGE_READWRITE.
  • !heap -x placed the target 88 bytes inside a 560-byte block marked LFH Allocated, beginning at 0x0000015B06E77B70.
  • Disassembly showed a reference to VBE7!g_PPExSP. The call stack included VBE7!EpiInvokeMethod and VBE7!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

  1. 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?
  2. Does the repeated instruction sequence referencing VBE7!g_PPExSP on a PAGE_READWRITE heap page match a known issue? Is there a supported fix or workaround?
  3. 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?
  4. 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

Developer technologies | Visual Basic for Applications
0 comments No comments

1 answer

Sort by: Most helpful
  1. Brian Pham (WICLOUD CORPORATION) 1,595 Reputation points Microsoft External Staff Moderator
    2026-11-30T06:47:37.9233333+00:00

    Hi @Michal Studzizur ,

    Thank you for the detailed investigation notes, including the Excel 2611 builds, the Safe Mode comparison, and the tracing around the native DLL and PDF export.

    For your concern, there are a few points I can help you answer:

    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?

    Safe Mode bypasses alternative startup locations, changed toolbars, Excel startup folders, Excel add-ins, and most COM add-ins. Add-ins can also interfere with Excel.

    Since graphics acceleration, add-ins, and startup folders have already been checked, I would isolate the remaining normal-mode items one at a time:

    • File > Options > Add-ins > Manage > COM Add-ins > Go. Clear all, restart Excel normally, then re-enable one add-in at a time. Repeat with Excel Add-ins.
    • The native calculation DLL. It is loaded through VBA Declare, not as a COM add-in, so Safe Mode would not automatically keep it out of EXCEL.EXE.
    • ExportAsFixedFormat / the temporary report workbook path, separately from the DLL call.

    Microsoft’s Excel check troubleshooter can also isolate add-ins, startup-folder files, and toolbar settings in normal mode. It may move startup files and change the registry, so back those up first, as described in the Safe Mode troubleshooting article above.

    Does the repeated instruction sequence referencing VBE7!g_PPExSP on a PAGE_READWRITE heap page match a known issue? Is there a supported fix or workaround?

    That match is not confirmed. The current Excel for Windows known-issues list does not document this pattern as a known Excel 2611 / VBA 7.1 issue, and it does not publish a supported fix or workaround for an execute access violation (0xC0000005) on a PAGE_READWRITE heap page whose bytes reference VBE7!g_PPExSP.

    A similar execute-AV on a live PAGE_READWRITE heap block that contains a reference to VBE7!g_PPExSP has been discussed publicly, but that report is not a Microsoft known issue and does not identify a serviced build or supported mitigation.

    Seeing VBE7 on the dispatch stack at the point of the execute AV also does not, by itself, prove a VBA runtime defect. An earlier in-process memory error can still surface later inside VBE7.

    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?

    That is not confirmed as a documented Excel known issue. A native DLL loaded into EXCEL.EXE remaining loaded after the workbook is closed, while the Excel process stays open, is expected process lifetime for a Declare-loaded module. It is not, by itself, evidence of a published Excel/VBA defect.

    There are separate published cases where an Excel process stays in memory after quit because a COM add-in holds a global Excel reference. That is a different scenario from a calculation DLL loaded through VBA Declare.

    What specific trace should I capture during the next session? What evidence would help distinguish a VBA runtime issue from an earlier memory error in the calculation DLL or another in-process component?

    Q&A cannot determine from public documentation how that heap block acquired PAGE_READWRITE, or why execution was directed to it. The most useful evidence on this channel is a comparison run in normal mode, plus the Windows faulting-module record.

    Please capture:

    • Windows Event Viewer > Windows Logs > Application, for the EXCEL.EXE Application Error: faulting module, exception code, and fault offset.
    • Whether the same close/reopen + report loop still fails when the native DLL is never loaded in that Excel process.
    • Whether it still fails when the DLL is used, but ExportAsFixedFormat is skipped.
    • Whether it still fails with COM add-ins and Excel add-ins all disabled in normal mode.

    If the crash still occurs with the calculation DLL never loaded, that points away from that DLL as the first writer. If it occurs only after the DLL has been loaded and reused across workbook opens, that still does not prove the DLL is defective, but it does keep the DLL and any other in-process module in scope, rather than treating VBE7!g_PPExSP as a confirmed VBA runtime bug.

    Please note that Microsoft Q&A is a community channel, so it is not the right place to fully answer every question in your dump analysis. On this thread I can only share what is already documented in official Microsoft sources, plus isolation steps based on that guidance. Confirming whether VBE7!g_PPExSP is a known Excel/VBA defect, or reviewing the dump for how that heap page acquired execute, needs a product or support channel.

    There are some channels that may be suitable for your concern and situation:

    In-app feedback (to the Excel product team):

    • In Excel, go to Help > Feedback or File > Feedback, then report the problem. Include a screenshot if possible, and select the option that allows Microsoft to contact you, with your email address. Microsoft documents this as the quickest way to get comments to the applicable product team; they read customer feedback daily. User's image
    • Please include Excel build 16.0.20625.20142, exception 0xC0000005, VBE7!g_PPExSP, a link to this thread, and the dump if the form accepts it. In-app feedback reaches the product team; it does not replace a support case, and it does not guarantee a reply to each dump question.

    Microsoft Support (dump review / break-fix):

    • A crash plus dump, and the question of whether this is a known issue, is a support investigation rather than a forum discussion.
    • If this is a business Microsoft 365 tenant, an admin can open a service request from the Microsoft 365 admin center (Help & support). Otherwise, start here 
    • If you have Unified Support, Partner Network developer benefits, or pay-per-incident support, those are the assisted Office channels

    If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.

    Thank you.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.