Forum Discussion
DataSource.Error: An IO error occurred while trying to access the file...
I'm trying to create a variable query that outputs the name of the file most recently modified in a certain folder. I actually accomplished this yesterday and the output was successful, but when I refreshed the query today I received the following error:
DataSource.Error: An IO error occurred while trying to access the file 'FilePath'.
Details:
FilePath
Code:
let
//Choose folder
Source = Folder.Files("\\xxx-my.sharepoint.com\personal\xxx\xxx\xxx\xxx\xxx\"),
//filter out all but Excel files
#"Filtered Rows" = Table.SelectRows(Source, each ([Extension] = ".xlsx")),
//sort in descending order by date modified
#"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"Date modified", Order.Descending}}),
output = #"Sorted Rows"{0}[Name]
in
output
Again, this was actually working yesterday. I still have complete access to the network folder that is trying to be accessed, so I don't think it's a permissions issue.
Any ideas?
Hi ccsrtw,
It seems folders exist in SharePoint online, please try the SharePoint Folder data source instead of Folder data source. See:
Best Regards,
Qiuyun Yu
11 Replies
- v-qiuyu-msftCommunity Support
Hi ccsrtw,
From the error message, it seems the file can't be accessed. As you mentioned you have permission to access the file, the issue can be caused by that the file is occupied by other programs or other users. Please use Handle to find all process accessed this file, then kill them to refresh query in desktop to see if issue persists.
Best Regards,
Qiuyun Yu- ccsrtwAdvocate I
Hi Qiuyun,
I downloaded Process Explorer (Handle w/ GUI), but I honestly have no idea how to identify which processes (if any) to kill. I killed anything related to Excel, but that hasn't helped. Any other tips?
Appreciate the help!
- v-qiuyu-msftCommunity Support
Hi ccsrtw,
Would you mind recreating a .PBIX file use the same data source to check if the same issue occurs?
Best Regards,
Qiuyun Yu
- v-qiuyu-msftCommunity Support
Hi ccsrtw,
As the original issue is solved and this thread is a little old, you can create a new thread so that communities can aware it and help you.
Thanks for your understanding and support.
Best Regards,
Qiuyun Yu