A locked VBA project is an ownership and recovery problem, not an invitation to bypass a password. If the workbook belongs to your organisation, confirm your authority, preserve the original and recover the code through an approved owner, backup or source repository. Do not download password crackers or alter the file with an undocumented hex-editing trick.
This article deliberately does not provide bypass instructions. The same steps could be used against code the reader does not own.
First, establish authority and impact
Record the workbook path, business owner, process it supports and reason access is needed. Ask:
- Does the organisation own the workbook and its VBA code?
- Is the request approved by the system or data owner?
- Does the file contain personal, financial or commercially sensitive data?
- What happens if the workbook is damaged or the macros change?
- Is there a known-good signed or backed-up copy?
If ownership is disputed, stop. Ask legal, HR or information security to resolve it before anyone attempts recovery.
Preserve the original
Make a read-only copy using your organisation's approved storage. Record a checksum if the workbook is important evidence or part of a regulated process. Work only on a separate copy.
Do not convert formats, run unknown macros or upload the file to an online recovery site. Microsoft warns that macros can carry malicious code. Office blocks macros from files obtained from the internet by default in supported scenarios, and that protection should not be casually removed.
Use supported recovery routes
Try these in order:
- Contact the author, former team owner or managed service provider.
- Search the approved source repository for exported
.bas,.clsand.frmfiles. - Use SharePoint or OneDrive version history to locate an accessible known-good version.
- Restore from an authorised backup under the normal recovery process.
- Ask Microsoft Support or an approved specialist what supported options exist for your exact Office version and file type.
Be careful with claims from recovery vendors. A tool being able to alter a file does not make its use authorised, safe or supported.
If the workbook still runs, document before changing it
You may be able to observe inputs, outputs, schedules, dependencies and failure messages without opening the protected project. Capture those facts. They can support a controlled rebuild even when the original source is unavailable.
Do not infer that a running macro is trustworthy. Review external connections, file writes, email actions and credentials before placing an inherited workbook back into service.
Prevent the next lockout
Once authorised access is restored or the process is rebuilt:
- store source modules in version control
- assign at least two accountable owners
- use an approved secret-management process
- document dependencies and recovery steps
- sign macros where your security design requires it
- restrict workbook and data access separately
- plan replacement when a desktop macro has become a critical shared service
VBA project protection can deter accidental editing, but it is not a substitute for source control, access governance or a recovery plan.
Sources
- Macros from the internet are blocked by default in Office
- Use policies to manage how Office handles macros
- Restore a previous version of a SharePoint file
- Digital signatures and certificates
Replace fragile reporting dependencies
If a locked workbook has become a business-critical reporting system, the Microsoft 365 Report Builders Space is a place to think through ownership, documentation and a safer replacement. Do not share the protected file or sensitive data there.
