Formula Errors

Fix Excel VBA Function Returns #NAME? and Missing Active Content Prompt

Emma BrownEmma Brown Nov 13, 2026 871 views

Question details

The user needs to restore an Excel VBA user-defined function such as =@ExtractEmail(Cell#) that returns #NAME? and resolve the missing Enable Active Content prompt in a macro-enabled workbook.

Fix Excel VBA Function Returns #NAME? and Missing Active Content Prompt
Product
WPS Spreadsheets / Microsoft Excel macro-enabled workbooks
Device & OS
not provided
Scenario
A workbook that previously showed an Enable Active Content prompt now opens without it, and a VBA user-defined function such as =@ExtractEmail(Cell#) returns #NAME?.
Observed behavior
The formula =@ExtractEmail(Cell#) returns #NAME? and the Enable Active Content prompt is no longer displayed when the workbook opens.
Before you start

Before troubleshooting, check whether the workbook is saved as an Excel Macro-Enabled Workbook (*.xlsm). If it is saved as .xlsx, locate a backup .xlsm file or exported VBA module because the macro code may have been removed.

Solution 1Recommended

Restore the macro-enabled workbook and enable active content

Use this when a VBA function returns #NAME? because the workbook is not in .xlsm format or macros are blocked.

A workbook saved as .xlsx cannot contain VBA modules. Excel may silently remove the macro code when a file is saved in a non-macro-enabled format, leaving formulas that call VBA functions with #NAME?.

1
Check the current file type

In WPS Spreadsheets or Excel, click File > Save As and check Save as type. If it shows Excel Workbook (*.xlsx), the VBA code may have been discarded.

2
Save as macro-enabled workbook

Set Save as type to Excel Macro-Enabled Workbook (*.xlsm), save the file, and reopen it.

3
Enable active content

After reopening, click File > Info > Enable Content and choose Enable All Content or Enable Macros. If the prompt still does not appear, use the macro security solution below.

4
Verify the ExtractEmail VBA module

Open the Developer tab, click Macros or Visual Basic, and confirm that ExtractEmail exists in a standard module. If it is missing, import the original .bas file or restore the .xlsm backup.

5
Re-enter and test the formula

Click the cell containing the formula, type =ExtractEmail(A2) or your exact cell reference, and press Enter to confirm the #NAME? error is cleared.

Restore the macro-enabled workbook and enable active content
Expected result: The #NAME? error should disappear when the workbook is saved as .xlsm, macros are enabled, and the ExtractEmail VBA function is present.
WPS Spreadsheets macro troubleshooting

Fix VBA #NAME? by Saving as .xlsm and Enabling Macros in WPS Spreadsheets

Open the affected workbook in WPS Spreadsheets, confirm the file is stored as an Excel Macro-Enabled Workbook (.xlsm), enable macros through Macro Security settings, and verify the ExtractEmail VBA module so the formula recalculates without #NAME?.

  1. 1. Open the workbook in WPS Spreadsheets: Launch WPS Office, click Menu > Open, and select the .xlsm or .xlsx workbook that contains the ExtractEmail formula.
  2. 2. Save as an Excel Macro-Enabled Workbook: Click Menu > Save As, set Save as type to Excel Macro-Enabled Workbook (*.xlsm), and save a copy if the current format is .xlsx.
  3. 3. Enable macros in Macro Security: Click Menu > Options > Security > Macro Security, choose a notification or trusted setting, click OK, then reopen the workbook to allow active content.
  4. 4. Verify the VBA function: Open the Developer tab > View Code or Macros and confirm ExtractEmail is present in a module. If it is gone, import the .bas module or restore the .xlsm backup.
  5. 5. Refresh the formula: Re-enter =ExtractEmail(cell) in the formula cell and press Enter to clear the #NAME? error.
Opens and resaves Excel Macro-Enabled Workbooks (.xlsm) to preserve VBA modulesFully compatible with Microsoft Excel .xlsx and .xlsm formatsBuilt-in macro security options to safely enable active contentFree download with easy migration from Microsoft Excel
microsoft office alternative - wps office

Frequently Asked Questions

Why does =@ExtractEmail(Cell#) return #NAME? in Excel?

The #NAME? error appears when Excel cannot find the ExtractEmail function. This usually means the workbook lost its VBA code because it was saved as .xlsx, or macros are disabled so the function is not loaded.

Can a workbook with VBA be saved as .xlsx?

No. The .xlsx format does not support macros or VBA modules. You must save the file as Excel Macro-Enabled Workbook (*.xlsm) to retain the ExtractEmail code.

How do I make the Enable Content prompt appear again?

Open the macro security settings: in Excel, go to File > Options > Trust Center > Trust Center Settings > Macro Settings and choose Disable VBA macros with notification. In WPS Spreadsheets, check File > Options > Security > Macro Security, then reopen the workbook.

Where can I check whether the ExtractEmail VBA function still exists?

Open the Developer tab and click Macros or Visual Basic. Look for ExtractEmail in a standard module. If it is missing, re-import the original .bas file or restore a backup .xlsm file.

What should I do if the formula still returns #NAME? after enabling macros?

Re-enter the formula without @ if your Excel version does not support the @ implicit intersection operator in that context, and confirm the function is in a module with Public scope.