SharePoint Document Issues

How to Save Word Documents to SharePoint Using VBA on Mac and PC

Natalie TaylorNatalie Taylor Nov 3, 2026 869 views

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.

How to Save Word Documents to SharePoint Using VBA on Mac and PC
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Open your Word document and press Alt + F11 to launch the Visual Basic for Applications (VBA) editor.

2
Insert the SharePoint Macro Code

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.

3
Verify the Trailing Slash

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.

Configure the VBA Save As Dialog for Windows PC
Tip for Default File Names: You can append a default file name right after the final slash in the .Name property if you want to pre-fill the document title for the user.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS website to download the free installer for your Windows or Mac device.
  2. 2. Install WPS Office: Run the downloaded file and follow the straightforward on-screen instructions to complete the installation.
  3. 3. Manage Documents Securely: Launch WPS Writer to open your existing documents, execute macros, and save files directly to the cloud without complex workarounds.
Full compatibility with Microsoft Word (.docx, .doc) macro-enabled formats.Built-in WPS Cloud integration for easy document saving and sharing across devices.Lightweight installation with a clean, tabbed interface familiar to Office users.
microsoft office alternative - wps office

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.