Fix WPS Office VBA Subroutine Missing from Macro Dialog After Adding Arguments
Question details
User needs to understand why a VBA Subroutine with arguments does not appear in the Macro dialog and how to run or edit it.

- Product
- WPS Office Spreadsheets
- Device & OS
- not provided
- Scenario
- The user created a VBA Sub procedure that was listed in the Macro dialog when it had no arguments, then added ByRef or ByVal parameters and noticed it disappeared.
- Observed behavior
- The procedure is hidden from the Macro dialog because Excel/WPS only lists runnable parameterless Sub procedures; it is still available in the Visual Basic Editor.
Open the workbook that contains the VBA module, and press Alt+F11 to open the Visual Basic Editor so you can see the Sub declaration and the arguments that must be supplied before running it.
Confirm the parameterized Sub in the Visual Basic Editor
Use this when you only need to view or edit the Sub and do not need to run it directly from the Macro dialog.
In WPS Office Spreadsheets, press Alt+F11 to open the Visual Basic Editor.
In the Project Explorer, expand the VBA project and double-click the module containing the Sub. Find the procedure whose declaration includes ByRef or ByVal parameters.
Create a parameterless wrapper macro to run the Sub with arguments
Use this when you want the Sub to appear in the Macro dialog and run with fixed or prompt-supplied argument values.
Run a VBA Sub with Arguments in WPS Office Using a Wrapper Macro
Instead of rewriting the original parameterized procedure, add a parameterless wrapper Sub in the WPS Visual Basic Editor. The wrapper supplies the required arguments and appears in the Macro dialog, so your existing Excel VBA code runs the same way in WPS Office Spreadsheets.
- 1. Open the Visual Basic Editor: In WPS Office Spreadsheets, press Alt+F11 to open the Visual Basic Editor.
- 2. Insert a module: Click Insert > Module to create a new standard module for the wrapper macro.
- 3. Call the parameterized Sub: Create a Sub with no parameters and call the original procedure with the required argument values inside it.
- 4. Save the macro-enabled workbook: Save the file in a macro-enabled format such as Excel Macro-Enabled Workbook (.xlsm).
- 5. Run the wrapper macro: Press Alt+F8, select the wrapper macro, and click Run.

Frequently Asked Questions
Why does my VBA Sub disappear from the Macro dialog after I add arguments?
The Macro dialog only lists parameterless Sub procedures. Once you add ByRef or ByVal parameters, Excel or WPS cannot request the required values from the dialog, so the procedure is no longer shown. It is still available in the Visual Basic Editor.
How can I run a VBA Sub that requires arguments?
Create a parameterless wrapper Sub that calls the original procedure and supplies the required values. Then press Alt+F8, select the wrapper macro, and click Run.
Can I still edit a parameterized Sub in WPS Office?
Yes. Press Alt+F11 to open the Visual Basic Editor, expand the project in Project Explorer, and double-click the module to edit the Sub normally.
Will my parameterized macro be lost if it is not listed in the Macro dialog?
No. The procedure remains in its module and can be edited or called by other code, including a parameterless wrapper macro.
How do I save a workbook with VBA macros in WPS Office?
Use File > Save As and choose Excel Macro-Enabled Workbook (.xlsm) or another macro-enabled format supported by WPS Office so the VBA code is retained.





