VBA & Macro Problems

How to Fix #VALUE! Errors in Macro-Enabled Excel ID Functions

Elise WilliamsElise Williams Oct 13, 2026 873 views

Question details

The user is experiencing a #VALUE! error in a macro-enabled Excel workbook when using custom VBA functions to generate employee IDs, especially after a recent Office update.

How to Fix #VALUE! Errors in Macro-Enabled Excel ID Functions
Product
Microsoft Excel
Device & OS
not provided
Scenario
Generating employee IDs using custom VBA functions in a macro-enabled workbook.
Observed behavior
The custom function returns a #VALUE! error instead of the ID, often caused by missing arguments or compatibility issues related to MSXML, .NET objects, or 64-bit architecture.
Before you start

Before troubleshooting your VBA code, ensure that macro execution is enabled in your Excel Trust Center settings and that your workbook is saved in a macro-enabled format (.xlsm).

Solution 1Recommended

Verify and Provide Required Function Arguments

The most common cause of a #VALUE! error in custom VBA functions is a missing or incorrectly formatted argument in the cell formula.

When a custom VBA function is designed to take an input (like an email address) to generate an output (like an employee ID), leaving the parentheses empty will immediately trigger a #VALUE! error.

1
Select the error cell

Click on the cell displaying the #VALUE! error in your worksheet.

2
Check the formula bar

Look at the formula bar to see how the custom function is being called (for example, =f_email2employeeId()).

3
Add the required argument

Ensure a valid string argument is passed inside the parentheses. Change the formula to include the required data, such as =f_email2employeeId("user@example.com").

4
Recalculate the formula

Press Enter to recalculate the formula and verify that the #VALUE! error is resolved and the expected ID is displayed.

Function Execution: Providing the exact data type required by your VBA macro ensures the code executes completely without returning standard Excel formula errors.
Run Macros smoothly in WPS

Use WPS Spreadsheet to Run Macro-Enabled Workbooks

WPS Office provides robust support for VBA macros, allowing you to seamlessly run your custom functions without the compatibility issues often caused by standard Office updates.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your .xlsm macro-enabled workbook.
  2. 2. Enable Macros: When prompted by the security warning at the top of the worksheet, click 'Enable Macros' to allow your VBA code to run securely.
  3. 3. Input the Formula: Select the target cell and enter your custom function with the correct arguments, e.g., =f_email2employeeId("user@example.com").
  4. 4. Execute the Function: Press Enter to calculate the result and generate the employee ID successfully.
Fully compatible with Microsoft Excel macro-enabled formats (.xlsm).Stable VBA environment that avoids sudden update-related compatibility breaks.Lightweight and fast execution for heavy macro processing and ID generation.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my custom Excel VBA function suddenly return a #VALUE! error?

This usually happens if a required argument is missing in the cell formula, or if a recent Office update has caused compatibility issues with components like MSXML or cryptography libraries used in your macro.

How do I fix a missing reference in Excel VBA?

Open the VBA Editor by pressing ALT + F11, navigate to Tools > References, and look for any libraries labeled 'MISSING'. Uncheck them and select the correct, updated library from the list below.

Can 64-bit Office updates break my existing 32-bit macros?

Yes. If your macro uses Windows API calls, migrating from a 32-bit to a 64-bit Office version requires updating the code with the 'PtrSafe' keyword and modifying specific data types (like using LongPtr).

Does WPS Office support VBA macros like Microsoft Excel?

Yes, WPS Office provides excellent VBA support, allowing you to open, edit, and run macro-enabled workbooks (.xlsm) smoothly while maintaining high compatibility with traditional Excel formulas.