Fix Safari Download Issues in macOS Excel Add-ins
Question details
Developers and users cannot trigger file downloads programmatically within an Excel add-in on macOS.

- Product
- Microsoft Excel for Mac
- Device & OS
- macOS
- Scenario
- Attempting to download files dynamically using FileSaver or Blob URLs within a custom Excel add-in running on Mac.
- Observed behavior
- The download process fails silently or gets blocked by Safari's internal webview restrictions, whereas the identical code works perfectly in Microsoft Edge on Windows.
Ensure you have backend server access to configure custom API endpoints and modify HTTP response headers for your add-in.
Route Downloads Through a Configured Server Endpoint
Bypass Safari's local blob restrictions by generating the file on the server and serving it with explicit attachment headers.
Safari's strict security policies inside the macOS Office webview often block programmatic local downloads like Blob URLs and FileSaver.js. To resolve this, you must rely on standard HTTP downloading behaviors driven by a secure server endpoint.
Set up a secure server endpoint that accepts the file data or dynamically generates the requested file on your backend.
Ensure your server endpoint explicitly returns the header Content-Disposition: attachment; filename="your_file_name.ext" alongside the appropriate Content-Type for the specific file format.
In your add-in's JavaScript code, create a hidden <a> element, set its href attribute to your newly created server endpoint URL, and append it to the document body.
Programmatically execute a .click() event on the appended anchor link to initiate the native browser download process, then promptly remove the link from the DOM.

Consult the Office Add-in Developer Community
If server-side routing does not fit your application's architecture, reach out to specialized developer communities for alternative edge-case workarounds.
Switch to WPS Office for a Seamless Mac Experience
Dealing with strict macOS webview restrictions and complex Excel add-in development can slow down your workflow. WPS Office provides a lightweight, highly compatible alternative for macOS, offering powerful built-in spreadsheet tools without the need to rely on problematic third-party web add-ins.
- 1. Download WPS Office: Visit the official WPS website and download the free WPS Office installer specifically designed for macOS.
- 2. Install and launch: Run the downloaded installer package and drag the WPS Office icon into your Applications folder to complete the setup.
- 3. Open your spreadsheets: Launch WPS Spreadsheet and open your existing Microsoft Excel files natively without worrying about broken add-in dependencies.

Frequently Asked Questions
Why do Blob URL downloads work in Windows Edge but fail in Mac Safari?
Safari, which renders the embedded web view for Office add-ins on macOS, enforces stricter security and cross-origin policies that heavily restrict or block programmatically triggered local downloads via Blob URLs. Microsoft Edge handles these browser permissions differently on Windows environments.
What specific HTTP headers must my server return to force a file download?
Your backend server must include the Content-Disposition header configured as an attachment (for example, Content-Disposition: attachment; filename="data.xlsx"). You must also provide the correct Content-Type header matching your file's extension.
Can I use a public third-party file generation API to fix this download issue?
It is highly discouraged to use untrusted third-party endpoints. Doing so exposes private user information and sensitive spreadsheet data to potential security breaches. You should always process private files through your own secure, trusted server.
Will FileSaver.js ever be fully supported in macOS Office add-ins?
Full support is dependent on Apple's ongoing updates to Safari WebKit security policies and Microsoft's integration of the web view in Office for Mac. Until native blob handling is supported, server-side file generation remains the most reliable developer workaround.




