Working with OneDrive in VBA (revisited)
In June 2023 I wrote a post about working with OneDrive in VBA. The code I created worked with the use case I had at the time and five months later it broke. Faced with a new use case I did a complete rewrited.
I intended to repost the new code and never did, until today.
This morning I did another rewrite/refactoring. Created a Excel Workbook to test and demonstrate the code and posted it to Github for the world to enjoy.
Hopefully, the algorithms of the Internets will index this article and the Github repository and will provide someone else with the information and tools they need without the blood, sweat and tears I had to put into it.
For the non-technical
If you are tasking someone with writing a VBA macro that needs to interact with files stored in OneDrive the code I developed might be useful to them.
For the technically minded
This code will allow you to open files in VBA and translate URIs to localpaths so your VBA macros will not crash. All the details are on Github.
The Code
The code and workbook demonstrating usage is on Github. You can find it here:
dddd