VBA & Macro Problems

How to Fix Excel VBA Run-Time Error 13 on Different Computers

Adam DavisAdam Davis Nov 11, 2026 869 views

Question details

The user's Excel VBA macro works properly on their home computer but triggers a Run-time error 13 on a work computer. The affected workbook also utilizes FILTER formulas.

How to Fix Excel VBA Run-Time Error 13 on Different Computers
Product
Microsoft Excel
Device & OS
not provided
Scenario
Running a macro-enabled workbook containing modern dynamic array functions on computers with different software versions.
Observed behavior
The macro throws Run-time error 13 (Type Mismatch) on the work computer, and the FILTER formulas may display #NAME? errors due to version incompatibility.
Before you start

Before altering your VBA code, verify the exact Microsoft Office versions installed on both computers, as formula incompatibilities frequently trigger cascading VBA errors.

Solution 1Recommended

Check Excel Version and Formula Compatibility

Identify if the work computer uses an older version of Excel that lacks support for newer functions like FILTER, which causes #NAME? errors that VBA cannot process.

Run-time error 13 often occurs when VBA tries to read a cell value that contains a formula error. If a workbook uses the FILTER function (introduced in Microsoft 365 and Office 2021) and is opened in an older version of Excel, the formula returns a #NAME? error. When the macro references this cell, a Type Mismatch occurs.

1
Check Excel version

Open Excel on the work computer, click on 'File', and select 'Account' to view the exact product version and release year.

2
Identify unsupported formulas

Check your workbook for cells displaying #NAME? or #VALUE! errors, particularly those using dynamic array formulas like FILTER.

3
Update or modify formulas

If you cannot update Office, replace the FILTER function with backwards-compatible formulas (like INDEX and AGGREGATE) so the cells calculate correctly without triggering macro errors.

Check Excel Version and Formula Compatibility
Compatibility Check: Resolving the #NAME? errors on the spreadsheet level will often automatically clear the Run-time error 13 in your VBA macro.
Advanced Spreadsheet Capabilities

Run Macros and Dynamic Arrays Seamlessly in WPS Spreadsheet

If downgrading your formulas to accommodate older versions of Excel is not ideal, you can open your workbook in WPS Spreadsheet. It seamlessly supports VBA macros and modern dynamic array functions like FILTER, preventing the version-related errors that trigger VBA type mismatches.

  1. 1. Install WPS Office: Download and install WPS Office Free on your computer.
  2. 2. Open the workbook: Launch WPS Spreadsheet and open your macro-enabled workbook.
  3. 3. Run your macros: Navigate to the Developer tab, enable macros, and run your VBA scripts without triggering legacy version errors.
Fully compatible with Microsoft Excel formats (.xlsx, .xlsm, .xlsb)Natively supports advanced formulas and dynamic array functionsBuilt-in VBA editor for running, debugging, and editing macrosLightweight architecture ensures fast performance on any computer
microsoft office alternative - wps office

Frequently Asked Questions

What does VBA Run-time error 13 Type Mismatch mean?

Run-time error 13 occurs when VBA attempts to assign a value to a variable that conflicts with its declared data type. For instance, trying to perform mathematical operations on text, or attempting to read a cell that currently displays an error value like #NAME?.

Why does the FILTER function show a #NAME? error on my work computer?

The FILTER function is a modern dynamic array function introduced in Microsoft 365 and Excel 2021. If your work computer runs an older version of Excel (like Excel 2016 or 2019), it will not recognize the function and will output a #NAME? error.

How can I prevent Type Mismatch errors when reading cell values in VBA?

You can prevent this by adding error-handling logic in your code. Before processing a cell's value, use the IsError(Range("A1").Value) function to check if the cell contains an error. Additionally, use explicit type conversion functions (like CStr or CDbl) to guarantee the incoming data matches your variable's type.