Power Query [DataSource.error] not finding a file that I've moved preventing a refresh

kevsvette

New Member
Joined
Oct 5, 2015
Messages
24
I have setup a query & function that referenced a file path to a folder that I weekly dropped files into & updated my query that combines these 2020 files. Now that we're in 2021 I have moved those 2020 files to a different folder and started putting 2021 files in that same defined path which is used as a repository file which is generically named. When I refresh the query now I'm getting a [DataSource.error] Could not find file... with the correct path that ends with a file that I've moved. As this file no longer resides in the folder & I do not want them in my combine query the query will not refresh because it cant find that file. If I move it back into the folder it returns the same error with the next missing file. I've moved multiple files and will keep getting this error until all the files are back into the folder. When I moved all the 2020 files back into the folder it will refresh correctly.

I've gone to the Data tab >> the Data Source Settings & the path is correct for where I'm putting in the files I need combined. Just to test I browsed right back to the same file path & I'm still getting the same error.

I'm at a loss. Because this is company info I cannot upload an example. Has anyone ever had this problem & is there a resolution. I am using Excel 2016.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
It is hard to see without seeing any data or screenshots of your query but what I imagine is happening is that the file path has been hard coded into a step further on in your query so isn't dynamically changing when you move the file. When the query looks in the old location (which has been hard coded) it's not there so returning an error. By hard coded I mean Power Query inserts the location into one of your steps when you use the GUI commands.

I would recommend going through each step in your query and click the gear icon and check the formula bar and see can you work out if this is the case
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,189
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top