Fix Excel for Mac Access Denied Error When Refreshing CSV Queries
Question details
Users encounter a DataSource.Error indicating access is denied when trying to refresh CSV Power Query connections via VBA on Excel for Mac.

- Product
- Excel for Mac
- Device & OS
- macOS
- Scenario
- Refreshing CSV file connections in Power Query using automated VBA macros.
- Observed behavior
- Excel displays an 'Access Denied' error message, preventing the data query from refreshing. This is typically triggered by macOS sandboxing policies and corrupted Excel secure bookmark preferences.
Before applying these fixes, ensure your CSV files are not currently open in another application and verify that your macOS user account has read/write permissions for the folder where the files are stored.
Reset Excel Secure Bookmarks on Mac
Deleting the corrupted secure bookmarks preference file forces Excel to request fresh access to your files, effectively bypassing the sandbox restriction.
macOS uses secure bookmarks to remember which external files you have granted applications access to. When this plist file becomes corrupted or outdated, automated VBA tasks can fail with access errors.
Ensure Excel for Mac is completely closed before attempting to modify its preference files.
Open Finder, press Command + Shift + G on your keyboard to open the 'Go to Folder' dialogue box.
Paste the following path: ~/Library/Containers/com.microsoft.Excel/Data/Library/Preferences/ and hit Enter.
Locate the file named com.microsoft.Excel.securebookmarks.plist, drag it to the Trash, and empty the Trash. Reopen Excel and run your macro; you will be prompted to grant file access again.

Implement GrantAccessToMultipleFiles in VBA
Proactively requesting macOS sandbox file access directly within your VBA macro resolves the blockage before the query attempts to refresh.
Move CSV Files and Update Paths
Sometimes specific folder permissions block Excel. Moving the target files to a standard user directory can bypass complex permission hierarchies.
Try WPS Office for Seamless Data Management on Mac
If you frequently struggle with Excel for Mac's sandbox errors and complex VBA permissions, consider trying WPS Office. It provides an intuitive, lightweight, and highly compatible alternative for handling spreadsheets and data analysis without the steep subscription costs.
- 1. Download WPS Office: Visit the official WPS website and download the macOS installation package.
- 2. Install on Mac: Open the downloaded file and drag the WPS Office icon into your Applications folder.
- 3. Open Your Data: Launch WPS Spreadsheets and open your CSV or Excel files to manage your data effortlessly.

Frequently Asked Questions
Why does Excel for Mac need explicit permission to read CSV files?
macOS employs a strict security framework called 'sandboxing'. This restricts applications from accessing files outside their designated application containers unless the user explicitly grants permission, which can sometimes interfere with automated background scripts like VBA macros.
Where is the Excel secure bookmarks file located on macOS?
The file is located at ~/Library/Containers/com.microsoft.Excel/Data/Library/Preferences/com.microsoft.Excel.securebookmarks.plist. Because the Library folder is hidden by default, you can access it quickly using the 'Go to Folder' shortcut (Command + Shift + G) in Finder.
Does granting access once fix the Power Query refresh issue permanently?
Generally, yes. Excel stores your permission in the securebookmarks.plist file. However, if this file becomes corrupted, or if the CSV file path changes significantly, you will need to grant access again or reset the plist file entirely.
Can I completely disable macOS sandboxing for Microsoft Excel?
No, sandboxing is deeply integrated into the macOS architecture for security and privacy reasons. It cannot be disabled for individual App Store or Microsoft 365 applications.




