VBAProject remains in VBE after workbook is closed — persists in Safe Mode

Anonymous
2025-05-23T19:16:06+00:00

I’m using Excel 365 on Windows 11, and I’ve noticed a repeatable issue with the Visual Basic Editor (VBE).

When I open a workbook (.xlsx or .xlsm) and then close it, its VBAProject remains visible in the Project Explorer in VBE — and is still editable — even though the workbook has been closed and does not appear in Application.Workbooks.

This happens even when:

  • Excel is run in Safe Mode (excel.exe /safe)
  • No Add-ins are installed or active
  • The workbook is a simple test file with minimal or no code
  • Excel is closed cleanly, and no background Excel.exe processes remain

The leftover VBAProject is not removed from the VBE memory and persists until Excel is fully restarted.

Excel Version:
Microsoft® Excel® for Microsoft 365 MSO (Version 2504 Build 16.0.18730.20186) 64-bit

Can anyone from the product team confirm if this is a known issue? Is there a workaround or hotfix planned?

Microsoft 365 and Office | Excel | Other | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2025-05-23T19:37:42+00:00

Get rid of the Google Drive app - that solved this problem for me.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2025-05-23T19:58:35+00:00

    I've never seen a truly plausible explanation - file sharing / backup functionality of GDrive, timing of the file close, etc. doesn't really explain Excel's part in all that. But it never happens without GDrive being active, for me, at least.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2025-05-23T19:53:25+00:00

    Thank You.
    I exited the google drive app and the projects are now being removed as expected. I will test some more.
    Not sure why the google drive app would cause this behaviour, perhaps someone can cast light on this.

    Thanks again for you quick reply.

    Was this answer helpful?

    0 comments No comments