Location of One Drive pinned files in MS Excel

I’m trying to programatically manipulate the Favorites list in Excel (Office 365 – in a corporate computer, so no admin access), namely by downloading a file which is sent at irregular intervals (and always with a different name, because it includes the date of creation) and then favorite it in Excel.

I have googled extensively and found out that the recent files list is stored in the Registry, namely HKEY_USERS(USER ID long string)SoftwareMicrosoftOffice16.0excelUser MRUADAL_(another long string)File MRU.

The REG_SZ values on this key are named “Item 1” to “Item 100” and the data is in the format [F00000000][T<hex number?>][O00000000]*C:pathtofile.

Now, I figured out that if I change that first field to [F00000001], the file will appear as pinned (I have no idea about the [O00000000] – changed it, but didn’t seem to do anything).

My problem is that this list only seems to contain files in my local machine, but, being a corporate machine, I tend to use OneDrive extensively, and I have no idea where the OneDrive favorited files are stored.

There is another key just below that might seem like it could do the trick – HKEY_USERS(USER ID long string)SoftwareMicrosoftOffice16.0excelWeb Extension User MRUADAL_(same long string as above)File MRU, but the file “path” is a bunch of gibberish. Besides, it only has the one item, regardless of how many OneDrive files I favorite.

I’ve searched the Registry for the paths of OneDrive favorited files and it turned out empty.

So, where are these file paths stored? And how can I access them?

PS – While writing this, the workaround came to me which is to download the file, open and close it on the OneDrive sync folder (so it creates the registry value) and then favorite that. But if anyone knows, I’m still curious, as it can open up more efficient solutions.