Excel cannot display or reveal a forgotten VBA project password. To regain legitimate access, check your password manager and records, ask the workbook owner or administrator, or restore an authorized copy of the project that is not locked. Before troubleshooting, make a separate copy of the workbook and confirm that you are dealing with a VBA project lock—not a different Excel password.
What You’ll Need
- A copy of the workbook, preferably stored somewhere safe so you can inspect it without changing the original. VBA-enabled files commonly end in
.xlsmor.xlsb; older macro-enabled workbooks may use.xls. - Permission to open the file and, if it belongs to someone else or an organization, permission from its owner or administrator to access its code.
- Access to the places where the password or project source might have been stored, such as a password manager, team vault, deployment notes, version-control repository, or backup folder.
- Excel for Microsoft 365 on Windows if you want to check the VBA editor. Excel for the web cannot open the Visual Basic Editor. Excel for Mac has a VBA editor, although some commands and keyboard shortcuts differ.
Step-by-Step
- Confirm which password prompt you are seeing. Open the workbook and read the wording of the prompt. A VBA project password is requested when you try to view a protected project’s code in the Visual Basic Editor. It is different from a password required to open an encrypted workbook, a worksheet protection password, or a workbook-structure password. If Excel asks for a password before the workbook opens, that is not the VBA project lock. If you can open the workbook but cannot unhide, rename, or move sheets, check whether workbook structure is protected instead. Identifying the prompt prevents you from searching for the wrong credential.
- Make a safe working copy. Close the workbook, then use File Explorer to copy it to a folder where you can work without replacing the original. Keep the file extension unchanged. Reopen the copy in desktop Excel and, if a security banner appears, only enable macros if you trust the file and its source. A protected VBA project can be inspected without running its macros, so do not enable content just to try to reveal its password. If the workbook is business-critical, preserve the original file and its current location for the owner or support team.
- Check whether the project is actually locked. In Excel for Microsoft 365 on Windows, open the workbook and press Alt+F11 to open the Visual Basic Editor. If the editor is not available, use File > Options > Customize Ribbon and enable the Developer tab, then select Developer > Visual Basic. In the editor, choose View > Project Explorer if the project list is not visible. Select the relevant project and expand it if possible. A project that allows you to open its modules is not locked for viewing. A locked project typically shows a password prompt when you try to inspect it. Do not confuse that prompt with a password used by a macro or an add-in for some other purpose.
- Search approved password records. Look for the workbook’s name, project name, department, or the developer’s name in your password manager or company-approved credential vault. Search documentation, project handover notes, a secure team wiki, and messages where access details may have been handed over. Check whether the file has a documented owner or a standard credential process. Do not paste a password into a public chat, email it to a broad group, or upload the workbook to an unknown recovery service. If you find a candidate password, enter it only in the trusted desktop copy and make sure you are unlocking the intended project.
- Ask the person or team responsible for the workbook. Contact the original developer, file owner, team lead, or IT support through an approved channel. Include the exact file name and location, the Excel version, what you need to do with the code, and the wording of the prompt. Ask whether they can provide the password, unlock the project for you, or send an authorized source copy. In a managed environment, the owner may have to verify your access or create a new approved copy. This is usually the safest route because it preserves the intended version and avoids introducing a damaged or untrusted file.
- Look for an unlocked source or an earlier authorized version. Check the team’s version-control system, source-code repository, deployment package, backup system, or project archive. Search for a copy created before the project was locked, or for exported modules supplied by the developer. Confirm that the copy is current before using its code: an old version may be missing fixes or contain different business rules. If you find an unlocked workbook, compare its date and contents with the protected file and ask the owner to confirm that it is the right source. Do not replace a production workbook simply because an older copy opens in the editor.
- Use the password only through Excel’s normal prompt. When you have a password from an authorized source, return to the Visual Basic Editor and select the locked project or one of its code components. Enter the password in the prompt. If it is accepted, inspect the code you are authorized to access. If you need to edit the project, ask the owner whether editing is approved and how the updated workbook should be reviewed, saved, and distributed. A successful unlock does not mean you should change or redistribute code without permission.
- Document the resolution and protect the next handover. If access is restored, record the file’s owner, the approved storage location for the credential, and the process for requesting access. Follow your organization’s credential policy rather than adding a password to an ordinary notes file. If the password was lost and the owner supplies a replacement source, retain the old protected file until the replacement has been checked and approved. This makes later maintenance easier and reduces the risk of someone relying on an outdated or unofficial copy.
Excel does not provide a command to show a VBA project’s existing password or reset it after it has been forgotten. The normal password dialog checks a password you provide; it does not disclose the saved one. If no authorized record, owner, or usable source copy exists, contact your organization’s IT or application-support team and ask what recovery options are permitted. Avoid tools or instructions that claim to extract, remove, or bypass the project lock. They can violate policy, expose confidential code, or damage the file, and they do not establish that you are authorized to access the project.
Common Mistakes
- Assuming every Excel password is a VBA password. A prompt on opening the file, protecting a sheet, or changing workbook structure has a different purpose. Match the prompt to the protection feature before looking for credentials.
- Expecting Excel to reveal the saved password. The VBA editor does not include a show-password or forgotten-password recovery command. Repeatedly checking menus will not make the existing password visible.
- Trying guesses on the only copy. Repeated attempts can waste time, and editing or resaving a valuable file while troubleshooting can create avoidable risk. Work from a duplicate and ask the owner for the correct credential.
- Trusting an online password remover with a sensitive workbook. Uploading a file may disclose business logic, customer information, or other confidential content. It can also breach workplace rules. Use only recovery methods approved by the owner or administrator.
- Confusing access with permission to modify. Knowing the password does not automatically authorize changes, distribution, or use of code outside its original purpose. Confirm the scope of your access first.
Tips
- Keep the original file unchanged and give your working copy a clear name, such as a date-stamped troubleshooting copy. Store it in an approved location, not a personal cloud account.
- When asking for help, give support staff the exact file path, file extension, prompt text, and a brief description of the task. Avoid sending the password itself in the same support ticket.
- Check for a maintained source repository or deployment archive rather than assuming the workbook file is the only copy of the VBA code. Organizations often manage code separately from the workbook used by colleagues.
- Do not enable macros from an untrusted file just to inspect a project. Opening the VBA editor and running workbook macros are separate actions; use caution with any file whose origin you cannot verify.
- For future projects, agree in advance how credentials are stored, who owns them, who can approve access, and where maintainers can find the source code. A handover process is more dependable than relying on one person’s memory.
- On Windows, Alt+F11 opens the Visual Basic Editor in desktop Excel. On Mac, use Developer > Visual Basic; the keyboard shortcut can vary with the keyboard and macOS settings. Excel for the web does not include the Visual Basic Editor.
Troubleshooting
The file asks for a password before it opens. That is an opening-password prompt, not a VBA project password. Check the file owner’s records or ask the administrator for the authorized opening credential or an approved copy. Do not follow VBA-specific recovery instructions for this prompt.
The workbook opens, but the VBA editor is unavailable. Confirm that you are using desktop Excel, not Excel for the web, and that the workbook contains VBA. In Windows Excel, enable the Developer tab through File > Options > Customize Ribbon, then choose Developer > Visual Basic. On Mac, look for Developer > Visual Basic in the ribbon. If the command is disabled by an organization policy, ask IT rather than changing managed settings.
You can see the project but cannot open its modules. The project may be locked for viewing. Check your approved password records and contact the owner. Excel does not have a separate menu that reveals the password, and a worksheet password will not unlock the VBA project.
The password you were given is rejected. Check for typing errors, accidental spaces, or a password for a different project or file. Ask the source to confirm that the credential applies to this exact workbook version. Do not assume a similarly named workbook uses the same password, and do not modify the file to try to force access.
The workbook opens in read-only mode or displays a security warning. Read-only status and macro security are separate from the project lock. Ask the owner whether you have the right file permissions and whether the file is from a trusted source. Do not enable macros or change security settings to solve a password prompt unless the owner or administrator has approved that action.
No one can locate the password or a source copy. Escalate to the file owner, IT, or the application-support team. Explain what business process depends on the workbook and ask whether an approved rebuild, replacement, or recovery from managed backups is available. Keep the protected file intact while they assess it; an unsupported bypass attempt can make later recovery harder.
Frequently Asked Questions
Can Excel show me the current VBA project password?
No. Excel’s Visual Basic Editor can ask you to enter a password, but it does not display the saved password or provide a forgotten-password reset. Look for an authorized record or ask the project owner.
Is a VBA project password the same as a password to open a workbook?
No. A workbook-opening password restricts opening the file. A VBA project password restricts viewing the project’s code. Sheet protection and workbook-structure protection are separate features too, so identify the prompt before troubleshooting.
Can I check the VBA code without running the macros?
Yes, when the project is not locked and you have permission, you can open the Visual Basic Editor without running a macro. Do not enable or run code from a file unless you trust its source and have a valid reason to do so.
Can I recover the password in Excel for the web?
No. Excel for the web does not provide the Visual Basic Editor for viewing VBA projects. Use desktop Excel for normal VBA editing, but remember that the desktop editor still cannot reveal a forgotten project password.
Does this work the same way on a Mac?
The principle is the same: Excel does not reveal a forgotten VBA project password. Excel for Mac includes a Visual Basic Editor, but ribbon layout and shortcuts can differ. Use Developer > Visual Basic and follow your organization’s approved recovery process.
What if I own the workbook and the password is lost?
Start with your password manager, project notes, backups, and any source repository, then check with colleagues who maintained the file. If those options fail, ask IT or an authorized support provider about a permitted recovery or rebuild. Keep the original workbook unchanged while you investigate.
Related
- Excel Text to Columns Shortcut Key for Windows and Mac
- Excel Text to Columns Using Enter: Split Line Breaks
- Excel Text to Columns: Choosing a Number Delimiter
Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.
More in VBA & macros
- Excel VBA Freeze Worksheet: Freeze Panes or Lock CellsIn Excel VBA, use ActiveWindow.FreezePanes to keep rows or columns visible while you scroll; use worksheet protection when…
- Excel VBA Set Cell Value: Examples and Common IssuesTo set a cell value with Excel VBA, assign a value to a worksheet range, such as Range("A1").Value…
- Microsoft Excel VBA Dictionary: How to Use ItA Microsoft Excel VBA Dictionary is a key-and-value collection that lets a macro look up, count, and update…
- VBA Copy and Paste a Sheet: Code and OptionsTo copy a worksheet with VBA, use the sheet’s Copy method and specify where the duplicate should go.…
- VBA Do Until Loop: Syntax, Examples, and Common ErrorsA VBA Do Until loop repeats a block of code until a condition becomes true. Use Do Until…
- Excel VBA: Find the Last Column With Data in a RowTo find the last column containing data in a particular row, use ws.Cells(rowNumber, ws.Columns.Count).End(xlToLeft).Column. For the last column…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.