How to Troubleshoot Excel VBA Macros That Stop, Hang, or Report Row-Height Errors in WPS Office
Question details
The user needs to diagnose and resolve an Excel VBA macro that stops, hangs, or reports row-height errors after an Office update.

- Product
- WPS Office Spreadsheets (Excel VBA macros)
- Device & OS
- not provided
- Scenario
- A previously reliable Excel macro began failing after an Excel update, especially during row-height operations, and the user wants a precise diagnosis.
- Observed behavior
- The macro stops, hangs, or reports row-height errors; the exact error message and failing line depend on the macro and workbook.
Work on a copy of the workbook, not the original. In WPS Office Spreadsheets, press Alt+F11 to open the VBA editor and note the exact error message, the highlighted or reported code line, and the row-height values used by the macro.
Add Structured Error Handling to Identify the Exact Failing Line
Use this first when the macro stops or hangs without a clear message, so VBA reports the specific error number and code line.
Structured error handling captures the error number, description, and code line. This turns a vague hang or stop into an actionable diagnosis without changing the macro's main logic.
In WPS Office Spreadsheets, open the macro-enabled workbook and press Alt+F11 to open the Microsoft Visual Basic for Applications editor.
Below the Sub declaration, add On Error GoTo ErrorHandler and the statement Exit Sub, then add the ErrorHandler label.
In the error-handler section, add MsgBox "Error " & Err.Number & ": " & Err.Description & " at line " & Erl, vbCritical, "Macro Debug" and then run the macro again.
Use the reported line to locate the operation that fails, especially any row-height or display-related statement.

Review and Update Row-Height Operations After an Excel Update
Use this when the error points to row-height code or when macros that set or read row heights become unreliable after an update.
Test in a Copy and Check Macro Security or Trusted Locations
Use this to rule out workbook corruption, update-related file issues, or macro security blocks after the row-height code has been reviewed.
Repair and Run Excel VBA Macros Safely in WPS Office
Open the macro-enabled workbook in WPS Office, use the VBA editor to identify the failing line, review row-height operations, and run the corrected macro with full Excel file compatibility.
- 1. Open the macro workbook in WPS Office Spreadsheets: Download and install WPS Office, then open the Excel macro-enabled workbook (.xlsm or .xls) in WPS Spreadsheets.
- 2. Launch the VBA editor: Press Alt+F11 to open the Microsoft Visual Basic for Applications editor and locate the failing macro in the project tree.
- 3. Add error handling and locate the failure: Add On Error GoTo ErrorHandler or use Debug to capture Err.Number, Err.Description, and the failing line.
- 4. Update row-height code and test: Replace brittle row-height assumptions with explicit values and run the macro after saving a copy.
- 5. Save and continue working: Save the corrected workbook in WPS Spreadsheets or export it back to .xlsm for Excel compatibility.

Frequently Asked Questions
Why does my Excel VBA macro only hang when changing row heights after an update?
Office updates can alter row-height calculations or hidden-row behavior. Open the VBA editor with Alt+F11, add an error handler, and test whether Rows().RowHeight or AutoFit references the failing line.
Can WPS Office run Excel VBA macros?
Yes. WPS Office Spreadsheets supports VBA macros in Excel macro-enabled workbooks, including .xlsm files, although some complex VBA features may behave differently between versions.
How do I find the exact line that stops a macro?
Open the VBA editor, insert On Error GoTo ErrorHandler, and display Err.Number, Err.Description, and Erl in a message box. Run the macro on a copy and use the reported line to inspect the code.
Do macro security settings cause row-height errors?
Usually not. Security settings more often block macros from running at all. If the macro runs but reports a row-height error, focus on the code and update-related behavior first; check trusted locations to rule out file access issues.
Should I test the VBA macro in another Excel version?
Yes, testing in another supported Excel or WPS version can reveal whether the failure is version-specific. Save a copy, run the same macro, and compare the row-height result.




