Find Excel VBA Code That Displays a Popup on Startup
Question details
The user needs to find what displays a popup when an Excel workbook opens.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A popup appears when a workbook opens, but no relevant macro is visible under the Developer tab.
- Observed behavior
- The popup still appears after some VBA code was deleted and the workbook was saved.
Open the affected workbook and note the popup's exact text and when it appears. Check the file extension: an .xlsx workbook cannot store VBA macros, while .xlsm and .xlsb files can.
Inspect workbook and worksheet event code
Use the Visual Basic Editor to find event procedures that may run without appearing in the Macro dialog.
In Excel, select Developer > Visual Basic. On Windows, you can also press Alt+F11. If Developer is hidden, enable it through Excel's ribbon customization settings.
In the editor, select View > Project Explorer, expand the affected workbook, and double-click ThisWorkbook. Look for Workbook_Open or Workbook_Activate procedures and statements such as MsgBox or UserForm.Show.
Under Microsoft Excel Objects in Project Explorer, double-click each worksheet and look for procedures such as Worksheet_Activate or Worksheet_SelectionChange. You can also right-click a worksheet tab at the bottom of Excel and select View Code.
In the VBA editor, select Edit > Find, choose Current Project, and search for distinctive popup text, MsgBox, UserForm, and Auto_Open. Check standard modules for an Auto_Open procedure.

Check whether the popup comes from outside VBA
Use these checks if the workbook code does not explain the message.
Work with Excel spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface for opening and editing Excel files. It can make moving everyday spreadsheet work easier, but it does not diagnose or repair Excel's startup VBA behavior.

Frequently Asked Questions
Why can't I see the startup code under Developer > Macros?
Private event procedures, such as Workbook_Open, may not appear in the Macro dialog. Open Developer > Visual Basic and inspect ThisWorkbook and the worksheet modules instead.
Where is the View Code option?
In Excel, right-click a worksheet tab at the bottom of the workbook and select View Code. Do not right-click the popup title.
Can a cell display a message without VBA?
Yes. Select the cell and check Data > Data Validation > Input Message. A configured message can appear when the cell is selected.
What if the workbook's VBA project is locked?
If Project Explorer prompts for a password when you expand the project, ask the workbook owner for access. The project code cannot be inspected normally without it.




