How to Fix #VALUE! Errors in Macro-Enabled Excel ID Functions
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.

- 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 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).
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.
Click on the cell displaying the #VALUE! error in your worksheet.
Look at the formula bar to see how the custom function is being called (for example, =f_email2employeeId()).
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").
Press Enter to recalculate the formula and verify that the #VALUE! error is resolved and the expected ID is displayed.
Check VBA References and Component Compatibility
Recent Office updates can sometimes break references to MSXML, .NET objects, or cryptography components used in your macros, requiring a reference update.
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. Open WPS Spreadsheet: Launch WPS Office and open your .xlsm macro-enabled workbook.
- 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. Input the Formula: Select the target cell and enter your custom function with the correct arguments, e.g., =f_email2employeeId("user@example.com").
- 4. Execute the Function: Press Enter to calculate the result and generate the employee ID successfully.

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.




