Office for Mac Issues

Open an XLS File from an XLSM Workbook in Excel for Mac

Jason MillerJason Miller Dec 2, 2026 869 views

Question details

The user needs an XLSM workbook's VBA macro to select and open an XLS file in Excel for Mac.

Open an XLS File from an XLSM Workbook in Excel for Mac
Product
Microsoft Excel for Mac
Device & OS
macOS
Scenario
A macro that opens or selects a legacy XLS workbook works on Windows but needs to run on a Mac.
Observed behavior
The XLS file may not be selected or opened because of differences in file dialogs, paths, permissions, or legacy format handling.
Before you start

Place the XLSM workbook and a test XLS file in a local folder you can access. Open the XLSM file in Excel for Mac and enable macros only if you trust the workbook.

Solution 1Recommended

Use a Mac-compatible VBA file picker

Use this approach to replace a Windows-specific file dialog or path with a picker that lets the user select the XLS file on the Mac.

The example checks the selected extension after the user picks a file, rather than relying on a platform-specific file filter. It also handles cancellation.

1
Open the VBA editor

In Excel, open the XLSM workbook, then choose Tools > Macro > Visual Basic Editor. Insert a module in a trusted test workbook if you want to isolate the picker first.

2
Add a test macro

In the module, enter: Sub OpenLegacyXLS() Dim p As Variant p = Application.GetOpenFilename() If VarType(p) = vbBoolean Then Exit Sub If LCase$(Right$(CStr(p), 4)) <> ".xls" Then MsgBox "Please select an XLS file." Exit Sub End If Workbooks.Open Filename:=CStr(p) End Sub

3
Run the picker

Choose Tools > Macro > Macros, select OpenLegacyXLS, and click Run. Select the local XLS file and grant any access requested by macOS or Excel.

4
Check the result

If the sample works, adapt your original macro to use the selected path instead of a Windows-specific path or dialog. If it fails, try opening the same file through File > Open to check file access and format compatibility.

Use a Mac-compatible VBA file picker
Macro access: If the macro cannot run, check Excel's macro security settings and any security prompt shown when opening the trusted XLSM workbook. Do not enable macros in an untrusted file.
Free Microsoft Office alternative

Work with Excel files in WPS Office

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and support for common Excel formats, making it easier to move everyday workbook tasks between office suites. Excel VBA behavior and macro availability may differ, so test macro-enabled workflows before migrating.

Open and edit spreadsheet data without relying on the Excel for Mac interface.Compatible with common Microsoft Excel formats, including XLS and XLSX.Use a familiar spreadsheet interface for everyday workbook tasks.Move compatible documents between WPS Office and Microsoft Office.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Windows VBA file dialog fail on Excel for Mac?

Windows-specific dialog objects, file paths, or filters may not work the same way on macOS. Try Application.GetOpenFilename and use the path returned by the picker instead of a hard-coded Windows path.

How can I tell whether the problem is the macro or the XLS file?

Choose File > Open in Excel for Mac and select the same XLS file. If it opens manually, test the file picker in a new sample workbook; if it does not, check access permissions and whether Excel can read the file.

What happens if I cancel the VBA file picker?

Application.GetOpenFilename returns False when the user cancels. Check the return value before passing it to Workbooks.Open, as shown in the sample macro.

Should I save the XLS file as XLSX or XLSM?

Use File > Save As and choose XLSX for a workbook that does not need macros. Choose XLSM if the workbook contains macros that must be retained, and update any macro checks that expect an .xls extension.