logo
search
File Sharing Problems

How to Save Excel Files to a Network Drive on Mac and Windows (VBA Guide)

Tauseeq MagsiTauseeq Magsi Oct 19, 2026 868 views

Question details

The user needs to save Excel workbooks to an SMB network drive or UNC path in a mixed Mac and Windows environment.

How to Save Excel Files to a Network Drive on Mac and Windows
Product
Microsoft Excel
Device & OS
Mac and Windows
Scenario
Automating or configuring the process of saving files to a shared network location across different operating systems.
Observed behavior
Excel for Mac lacks the default save-location setting available in Excel for Windows, necessitating a VBA macro workaround to explicitly save the active workbook to a network path.
Before you start

Ensure your network share is properly mounted and accessible on your Mac, or that you have sufficient write permissions to the UNC destination folder on Windows. Additionally, verify that macros are enabled in your Trust Center settings.

Solution 1Recommended

Use VBA Macros to Save to Network Drives (Mac and Windows)

Apply a specific VBA script based on your operating system to programmatically bypass local default save limitations and push your active workbook directly to a network path.

Because Mac and Windows handle network file systems differently, you must use distinct path formats in your VBA code. Mac relies on SMB file URLs or mounted-volume paths, while Windows supports Universal Naming Convention (UNC) paths directly without mapping a drive letter.

1
Open the VBA Editor

In Excel, press 'Alt + F11' (Windows) or 'Option + F11' (Mac) to open the Visual Basic for Applications (VBA) editor.

2
Insert a New Module

Click 'Insert' in the top menu and select 'Module' to create a new blank script window.

3
Add the Mac SMB Code (For Mac Users)

Paste the following code, modifying the networkPath variable to match your specific server details: Sub SaveWorkbookToNetworkDrive() Dim networkPath As String networkPath = "smb://server/directory/" ActiveWorkbook.SaveAs networkPath & ActiveWorkbook.Name End Sub

4
Add the Windows UNC Code (For Windows Users)

Paste the following code, substituting the UNC path for your specific shared directory: Sub SaveWorkbookToNetworkDrive() Dim networkPath As String networkPath = "\\server\directory\" ActiveWorkbook.SaveAs networkPath & ActiveWorkbook.Name End Sub

5
Run the Macro

Close the VBA editor and return to your workbook. Press 'Alt + F8' (Windows) or 'Option + F8' (Mac), select 'SaveWorkbookToNetworkDrive', and click 'Run' to save the file.

Use VBA Macros to Save to Network Drives (Mac and Windows)
Path Modifications: Ensure you replace 'server' and 'directory' in the code snippets with the actual IP address or hostname of your server and the exact folder names.
Seamless Network File Management

Easily Save and Manage Shared Files with WPS Office

WPS Office offers native support for saving directly to network drives across both Mac and Windows environments without needing complex VBA scripts for standard sharing. It is highly compatible with Microsoft Excel formats.

  1. 1. Open WPS Spreadsheets: Launch WPS Office and open your current spreadsheet or workbook.
  2. 2. Access Save As Menu: Click the 'Menu' button in the top-left corner and select 'Save As' from the drop-down list.
  3. 3. Navigate to the Network Drive: In the file explorer window, select your mounted network drive (Mac) or input your UNC path into the address bar (Windows).
  4. 4. Confirm Format and Save: Ensure the 'File Type' is set to your preferred Excel format (.xlsx or .xlsm if using macros) and click 'Save'.
Fully compatible with Microsoft Excel file formats (.xlsx, .xls, .xlsm).Native support for accessing and saving to SMB and UNC network drives.Built-in advanced VBA macro support for automating your cross-platform workflows.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel for Mac lack the default save-location feature found in Windows?

Excel for Mac integrates with the native macOS file system structure (which utilizes Finder), while Excel for Windows relies on Windows File Explorer standards. Because macOS handles network volumes differently, Office for Mac currently doesn't expose the exact same default network path configuration settings in its UI.

How do I mount an SMB drive on a Mac before running the VBA macro?

Open Finder, press Command + K to open the 'Connect to Server' dialog, enter your 'smb://server/directory/' address, and click 'Connect'. Once mounted, the VBA macro can successfully execute the save command.

Can I save to a UNC path without mapping a drive letter on Windows?

Yes. Windows natively supports Universal Naming Convention (UNC) paths (e.g., \\server\directory\). You can input this directly into the 'Save As' dialog or specify it as the path string in your VBA macro.

Why am I getting a 'Path not found' error when running the macro?

This error typically occurs if the network share is not accessible, the drive isn't properly mounted (especially on Mac), the UNC path is misspelled, or you lack the necessary write permissions for the specified directory.