Open an XLS File from an XLSM Workbook in Excel for Mac
Question details
The user needs an XLSM workbook's VBA macro to select and open an XLS file 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.
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.
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.
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.
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
Choose Tools > Macro > Macros, select OpenLegacyXLS, and click Run. Select the local XLS file and grant any access requested by macOS or Excel.
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.

Open and convert the legacy XLS file manually
Use this method if Excel cannot open the legacy file through the macro or if the workflow can use a newer file format.
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.

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.




