Closed 4lm1ghty closed 9 months ago
Hi @4lm1ghty ,
Thank you for the feedback!
Indeed it would be hard to figure this out, but my best guess is that there was an OneDrive update which caused the issue, in between the calls.
Please note the rebuildCache
parameter in both GetLocalPath
and GetRemotePath
. By default it is set to False
as we want to read the OD info as few times as possible. For example, parsing the SQLite database file which is a recent change (dat file was removed entirely a few months ago), can take up to half of a second and so the code only reads the info once and then re-uses it.
If you use GetLocalPath
on 1000 files for example, in a loop, then it doesn't make sense to read all the OD info for each file because it would be slow and it's unlikely there is an update to the software or a major change (like a new mapped SharePoint folder) within the time it takes to loop those files. However, for independant bits in your program, it makes sense to set rebuildCache
to True
which allows you to read all the information again if you want to be 100% sure the account is still connected and the info is up to date.
Happy to answer any questions you might have. Thanks!
Hello,
first of all an incredible big thank you to both of you. This Project is awesome and still supported after so much time, great job!
I already fixed the problem, but i am still curious what caused the issue, so it doesnt happen again. Anyway I can fully understand if there is no time to look into something that isnt a problem anymore.
I recently (like 6 to 8 weeks ago) updated the LibFileTools from here into my personal xlsb and always pull the code from there into each xlsm file i am using it with. I have never had any problems, using this since 2019, maybe earlier. 13 hrs ago I had a perfectly working file with a working
GetLocalPath(ThisWorkbook.Path)
, while doing some tests that were completely unrelated to it, suddenly runtime error 76 "Path not found" on this partGet_Latest_File(FilePath, FileName)
.The Path of the workbook in windows explorer is: "C:\Users\User\OneDrive Company Name & Name\Köln\Stadion Köln"
GetLocalPath(ThisWorkbook.Path)
delivered: "C:\Users\User\OneDrive Company Name & Name\Stadion Köln"The directory after OneDrive was missing. I disabled OneDrive and autosave and it suddenly worked again and included "\Köln\" again in the path.
The first fix i tried was the code by Guido, which worked instantly:
How likely is it that Windows/OneDrive updated at 2am while the file was open and the code was running seconds earlier? I know its like looking for a needle in a haystack, but why would it not work from literally one second to another.
Again, thank you very much!
Best Regards