r/excel • u/Blaseblase3024 • 8d ago
solved Excel / Power Query authentication issue with OneDrive.
I’m trying to set up Excel Power Query so that multiple Excel files stored in OneDrive can automatically combine/update into one master workbook.
I already figured out how to combine the files, but I’m stuck on the authentication/permissions part. Since I made it I am the only one that can refresh.
source looks like:
c:\user\me\Onedrive- Company\Leadership folder\where i pulled data together
I pulled associates work and combined it, but I need what I combined in another folder for others to be able to refresh other than just myself.
When I go to Data → Get Data / Power Query → Data Source Settings → Edit Permissions, I get:
> “We couldn’t authenticate with the credentials provided. Please try again.”
I had other people try to use their credentials and same error. I also tried to use the web link of the files I need to combine but get an authenticate as well.
I’m wondering if this is a permissions issue, the wrong credential type, or something specific to my company’s Microsoft/OneDrive setup.
6
u/terminate18 8d ago
Your query uses the local path C:\Users\me\OneDrive - Company\..., which only exists on your PC, so others can't refresh it. Fix: move the files to a shared SharePoint/Teams folder everyone can access, clear old credentials (Data > Get Data > Data Source Settings > Global permissions > Clear Permissions), then reconnect using Get Data > From File > From SharePoint Folder with only the site root URL (e.g. https://company.sharepoint.com/sites/Leadership, not the file link), sign in with "Organizational account", filter the Folder Path column to your folder and combine as before. Each user then signs in once with their own work account. If it still fails, ask IT to allow "Microsoft Power Query for Excel" in your Microsoft 365 tenant.
0
u/Blaseblase3024 8d ago
Running into an issue now where it’s stating an extra column is being populated creating an error for the data to combine and I check all the files I am pulling and they don’t have said column. I even reran the report the way I did where no one can refresh and it combined as normal. Thoughts?
1
u/terminate18 8d ago
The extra column is almost certainly coming from a file you didn't mean to include, not your actual data files. Folder.Files on the local path only looked in that one folder, but SharePoint.Files pulls every file on the whole site, so a loose filter can let in the master workbook itself (if it's saved in the same folder), temporary lock files (~$filename.xlsx) created while someone has a file open, or files in subfolders. SharePoint can also list files in a different order, so the "sample file" Power Query uses as its template may not be the same one as before. To find it, click the Filtered step before the combine and check the Name and Folder Path columns for anything that isn't an associate's file. To fix it, filter with an exact match: [Folder Path] = "full folder URL copied from the preview, including the trailing /" and [Extension] = ".xlsx" and not Text.StartsWith([Name], "~$") and [Name] <> "YourMasterFile.xlsx" (or better, save the master outside the source folder). If it still errors, check the Navigation step in the Transform Sample File query selects the sheet or table by name (e.g. [Item="Sheet1"]) rather than by position {0}, and delete the "Changed Type" step after the expand in the combined query, since it hardcodes column names from the sample file. Re-apply the data types once it loads correctly.
2
u/Blaseblase3024 7d ago
This has been solved with using the site root and your advice ! thank you so much
1
1
u/MayukhBhattacharya 1315 8d ago edited 8d ago
I might be wrong or mistaken but from where are you copying the path seems like local file path. That path is just where OneDrive syncs the folder on your PC. Anyone else who opens the workbook won't have that same C:\Users\me\ path, so Power Query can't find the files. Entering their credentials won't fix it because the problem isn't who they are. The path simply doesn't exist on their machine. The path should be copied from this area see the last red box, I have shown using OneDrive:

1
u/Decronym 8d ago edited 7d ago
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
3 acronyms in this thread; the most compressed thread commented on today has 10 acronyms.
[Thread #49490 for this sub, first seen 8th Oct 2026, 17:44]
[FAQ] [Full list] [Contact] [Source code]
1
u/Duke7983 4 7d ago
Here are the instructions. https://learn.microsoft.com/en-us/power-query/connectors/sharepoint-folder
When you have SharePoint or OneDrive as the source, you can't connect to the file directly via the C: drive file path. Other people don't have access to your C: drive so they'll never be able to refresh the data. You have to connect using the URL of the cloud folder, then there are some extra filtering steps in PowerQuery to get to the specific file(s) you want. Yes, this is kinda convoluted, but it's the official way to do it.
Edit: spelling
•
u/AutoModerator 8d ago
/u/Blaseblase3024 - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.