VBA & Macro Problems

How to Record or Write an Excel VBA Macro for Keyboard Actions in WPS Spreadsheets

Elise WilliamsElise Williams Nov 13, 2026 869 views

Question details

The user wants to record or write an Excel-compatible VBA macro that performs keyboard actions in WPS Spreadsheets, and needs a stable alternative when the macro recorder or SendKeys misses steps.

Product
WPS Spreadsheets (VBA/Macro)
Device & OS
not provided
Scenario
Automating navigation, selection, or typing actions that would normally be performed with the keyboard.
Observed behavior
The macro recorder may not reliably capture navigation, dialog, selection, or context-sensitive actions, and Application.SendKeys can be unstable.
Before you start

Before recording or writing macros, enable the Developer tab in WPS Spreadsheets via File > Options > Customize Ribbon. Save the workbook as a macro-enabled Excel or WPS format so the VBA code is retained.

Solution 1Recommended

Record a Macro for Keyboard Actions in WPS Spreadsheets

Use this method when you want to capture a short sequence of keyboard actions quickly and test whether the recorder captures them reliably.

Recording is fastest for simple typing and menu actions. It is not reliable for navigation keys, dialogs, selections, or context-sensitive behavior.

1
Enable the Developer tab

In WPS Spreadsheets, click File > Options > Customize Ribbon, check Developer in the right pane, and click OK.

2
Start recording

Go to the Developer tab, click Record Macro, enter a macro name, choose This Workbook, optionally assign a shortcut key, and click OK.

3
Perform and stop

Perform the required keyboard actions one at a time, then click Stop Recording on the Developer tab.

4
Run and test

Open Developer > Macros, select the macro, click Run, and verify whether all keyboard actions are captured.

Limitation: If navigation, dialogs, or context-sensitive actions are skipped, use the direct VBA method in the next solution.

Automate Keyboard Actions with Excel-Compatible VBA Macros in WPS Spreadsheets

Use WPS Spreadsheets to record or write VBA macros that automate navigation, selection, and typing, with direct VBA alternatives to unreliable SendKeys.

  1. 1. Download WPS Office: Go to the official WPS website and click Download WPS Office Free, then install it on your computer.
  2. 2. Open the macro workbook: Launch WPS Spreadsheets and open the .xlsm or .xlsx workbook that contains or will contain the macro.
  3. 3. Enable the Developer tab: Click File > Options > Customize Ribbon, check Developer, and click OK.
  4. 4. Record or write the macro: Use Developer > Record Macro to capture actions, or Developer > Visual Basic to write direct VBA code for keyboard actions.
  5. 5. Run and save: Run the macro from Developer > Macros and save the workbook as macro-enabled so the automation is retained.
Excel-compatible VBA macro recorder and editorOpens and saves .xlsm and .xlsx workbooksDirect object-model commands reduce SendKeys riskFree and lightweight Office suite
QA img-9

Frequently Asked Questions

Does WPS Spreadsheets support recording Excel VBA macros?

Yes. WPS Spreadsheets includes a Developer tab with Record Macro and a VBA editor, and it can open and save .xlsm workbooks, so many Excel VBA macros run without conversion.

Why are some keyboard actions not captured by the macro recorder?

Navigational keys, dialog actions, selections, and context-sensitive commands are often not recorded reliably. In such cases, write a direct VBA Sub procedure instead of trying to record or replay keystrokes.

How can I navigate to an address stored in a cell using VBA?

Use Application.Goto with the target range or address, such as Application.Goto Range("A1") or Application.Goto Range("A" & Selection.Row).Value. Avoid SendKeys for navigation.

When should I use Application.SendKeys in a macro?

Only as a last resort when no reliable VBA object-model command exists, because SendKeys depends on focus and timing and may send keys to the wrong window.

Can I run my existing Excel .xlsm macro workbook in WPS Office?

Yes, WPS Spreadsheets can open .xlsm workbooks and run compatible VBA macros. You may need to enable macros through the security prompt when opening the file.