How to Save Word Documents to SharePoint Using VBA on Mac and PC
Question details
The user requires a VBA macro solution to open the Save As dialog and default the saving path to a SharePoint online location instead of local folders, with support for both Windows and macOS.

- Product
- Microsoft Word
- Device & OS
- Windows and macOS
- Scenario
- Automating document saves to cloud environments via macros to ensure files are directly stored in a centralized SharePoint library.
- Observed behavior
- Using wdDialogFileSaveAs in VBA defaults to local PC or Mac directories and fails to display SharePoint or other HTTPS online locations.
Ensure you have the exact HTTPS URL of your target SharePoint site and verify that you have appropriate write permissions for the document library where files will be saved.
Configure the VBA Save As Dialog for Windows PC
Set the dialog's Name property to the SharePoint HTTPS URL to automatically route users to the online location.
On Windows, Microsoft Office can directly interpret HTTPS SharePoint paths within the classic Save As dialog if the URL is formatted as a directory rather than a file.
Open your Word document and press Alt + F11 to launch the Visual Basic for Applications (VBA) editor.
Create a new module and insert the following code block: With Dialogs(wdDialogFileSaveAs) .Name = "https://[tenant].sharepoint.com/sites/[site]/" .Format = Word.WdSaveFormat.wdFormatXMLDocument .Show End With.
Ensure your SharePoint URL ends with a forward slash ('/'). This tells the dialog to open the directory rather than treating the URL as a file name.

Use OneDrive Sync Client Workaround on macOS
Since macOS Finder does not natively browse HTTPS SharePoint paths through VBA, sync the SharePoint library to a local Mac folder.
Try WPS Office for Seamless Document Management
If cross-platform macro compatibility and cloud saving in Microsoft Word are causing friction, consider WPS Office as a free, lightweight alternative. WPS Office provides excellent format compatibility, built-in cloud storage options, and a familiar user interface that makes transitioning effortless.
- 1. Download the Installer: Visit the official WPS website to download the free installer for your Windows or Mac device.
- 2. Install WPS Office: Run the downloaded file and follow the straightforward on-screen instructions to complete the installation.
- 3. Manage Documents Securely: Launch WPS Writer to open your existing documents, execute macros, and save files directly to the cloud without complex workarounds.

Frequently Asked Questions
Why does wdDialogFileSaveAs only show local folders on my Mac?
SharePoint uses HTTPS, and the macOS Finder (which powers the Save dialog on Mac) does not natively recognize web URLs as standard browsing locations in the same way Windows Explorer does.
Can I save a Word document to SharePoint via VBA without opening the dialog box?
Yes. Instead of using the dialog, you can use ActiveDocument.SaveAs2 FileName:="https://your-sharepoint-url/filename.docx" to save the document silently in the background, provided your Office application is already authenticated to the SharePoint site.
Is the newer Office Add-in model better for saving files to SharePoint?
Yes. For modern cross-platform needs, especially covering both Mac and Word for the Web, using the newer Office JavaScript Add-in API provides more robust and native tools for authenticating and routing files to online locations compared to traditional VBA.




