DataSource Error Access To The Path is Denied / PowerQuery Mac

Copper Contributor

I am trying to read a datasource (CSV) into Power Query.  I keep getting DataSource error saying that it cannot read the file.  This happens whether I try using "Get Data" or just editing an existing query so that it points to a different source. 

 

An exception occurred: [DataSource.Error] Access to the path '/my/path/to/the/file.csv' is denied. (Session ID: 6cc4c6b5-96d6-4d58-b68a-f20fcab1aa8f)

 

Sometimes, If I make a copy of the file, then I can import that copy.  But if I change the name back to what I want it to be named, then it can't connect.  It's the same file, just with a different name. 


Sometimes when I go to Get Data, all the potential choices (ie.. all the CSV files) are grayed out. But if I rename one of the files then that one will (sometimes) not be greyed out and I can select it.  But if I change it back to the name I want, then it grays out again. 

 

Very frustrating as a simple duplication task (ie. duplicating a query and then adding a different source) has become very hard indeed. 

 

Any ideas why this might be happening? 

 

 

 

19 Replies

@Brett Kraiger have you resolved the problem? I have the same issue with JSON files

No I got zero responses here, and none in other places I tried to seek out help, so I gave up and taught myself rudimentary R and got around the problem that way.

@Brett Kraiger got the same issue, how did you solved it ?

@MHLachaps the trick is to always use the wizard to open the json, do not rename or move the json file.
This is the only way I found. Probably the wizard automatically creates some permission on the file (not at the file system level, it is something within excel). In excel for mac there is no way to change these permissions once created by the wizard

I gave up and taught myself R instead

@caprinalim Thx, not a JSON but just a simple excel csv. I have tried it all (rename, change directory, delete and expert again, ...) for 1 of the 2 files it worked, not for the other one (same source though ...)

I have the same issue. I have several CSV files provided externally which are in different folders based on month with one file in each. I am trying to write a query to combine the month files but March is allowed but January isn't! (for example). Using the wizard I get the same refusal. I moved the files from iCloud to local to see if that helps (it doesn't). The File Info data is apparently identical. Not really sure what MS are doing here.
If it adds anything to the solution, I've just discovered that copying and moving the files achieves nothing but opening the CSV in Excel and Save As (a CSV somewhere else) fixes the access issue. I'll try deleting the originals and replacing them in the original locations with the Saved As files. Not a solution but it might inform the real solution
I found it was a simple error for me. Basically my csv was labeled as "varient.csv" but the data source was "Varient.csv". Fixed the capitalization and it worked fine.

I've also previously found simply restarting the computer fixed the issue.
Good idea. I tried to eliminate any case or special characters "features" by renaming all lowercase and no spaces but to no avail.
I wonder if it's linked to what files are open and when. Having just had the failure above I closed the "reading" file, changed the name of the "source" file by making the first character UC, opened and closed it in Excel then reopened the "reading" file. Read worked. I'll try to be a bit more structured to try to focus down to where the problem occurs

I've got the same issue and I've just spent a couple of hours with MS tech support but did not get a solution. My issue only occurs when trying to import from a network folder. Interestingly the first tech support agent got me to run the license removal tool and after doing that the issue was resolved in a test file. I then tried my project Excel file and initially the problem persisted, but I then browsed to the file again in the wizard and then it imported successfully. I then tried the same process on other datasources in the same excel file but it did not work.

I have also tried opening my excel file in the Windows version and setting privacy to none and also setting the ignore privacy flag in the file. None of those steps helped, when I open it on mac its still not working.

I'm with the same issue, the only way that I found is as other replies mentioned ... that is using the wizard first and works, but I'm lossing to much time and when I try to work with a folder with differents files doesn't work, but working one by one inside of this folder yes... . If somebody find how avoid to use the wizard will be great.

@Brett Kraiger I had the same problem and nothing seemed to work (extra permissions, etc).

The problem occurred after changing the filename and although the name in de source path was exactly the name of the file (same capitals letters), it didn't work anymore.

At last I removed all capital letters in the filename and also removed the capital letters in de source path in Power Query. Suddenly the file was accessible again.

@Albert1835 

Thank you for taking the time to post. I removed capital letters and it worked for me also, mad!

I only had to change the filename caps to lower case and 'browsed' to the source file and it all worked.

Thank you!

FYI, I had the same issue in OCT2023. Filenames with spaces, dashes, and underscores open just fine. Adding capitals screws them up, and converting to lc restores the ability to load.

Thanks for this thread - you helped me solve my problem quickly!
Slightly similar issue (google lead me here, so maybe it will help someone else). On each folder, I had to unlock it.

@Brett Kraiger make sure your files are on a physical drive and not a virtual drive. This is a common error.

@Brett Kraiger One option which helped me is the following:

 

Go to Data -> Get Data (Power Query) -> Data Source Settings and then click on "Change File Path" to choose the file you would like to load. 

 

It did not let me load the original file, but I was able to change the name to a different one i.e. load-test.csv was throwing permission error, but when I changed file path to load-test1.csv, it started working.

abhatia1176_0-1725384493742.png

 

Hope this helps someone.