VBA & Macro Problems

How to Troubleshoot Excel VBA Macros That Stop, Hang, or Report Row-Height Errors in WPS Office

Anum MushtaqAnum Mushtaq Nov 13, 2026 869 views

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.

Troubleshoot Excel VBA Macros That Stop, Hang, or Report Row-Height Errors
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA editor in WPS Office

In WPS Office Spreadsheets, open the macro-enabled workbook and press Alt+F11 to open the Microsoft Visual Basic for Applications editor.

2
Insert an error handler at the top of the macro

Below the Sub declaration, add On Error GoTo ErrorHandler and the statement Exit Sub, then add the ErrorHandler label.

3
Capture the error number, description, and line

In the error-handler section, add MsgBox "Error " & Err.Number & ": " & Err.Description & " at line " & Erl, vbCritical, "Macro Debug" and then run the macro again.

4
Record the failing line and inspect the related code

Use the reported line to locate the operation that fails, especially any row-height or display-related statement.

Add Structured Error Handling to Identify the Exact Failing Line
Use a macro copy: Keep the original macro intact until you have confirmed the exact failing line.
WPS Office Spreadsheets

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. 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. 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. 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. 4. Update row-height code and test: Replace brittle row-height assumptions with explicit values and run the macro after saving a copy.
  5. 5. Save and continue working: Save the corrected workbook in WPS Spreadsheets or export it back to .xlsm for Excel compatibility.
Built-in VBA editor for diagnosing and editing Excel macros directly in WPS Spreadsheets.High compatibility with Excel macro-enabled workbooks such as .xlsm and .xls.Free to download and use, with a familiar ribbon interface for easy migration from Microsoft Excel.Lightweight performance while opening, testing, and running macro workbooks.
microsoft office alternative - wps office

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.