Mr_Ragweed2
Board Regular
- Joined
- Nov 11, 2022
- Messages
- 145
- Office Version
- 365
- Platform
- Windows
Hello and thanks for reading! I have a spreadsheet that is saved on multiple users desktop. The issue is i don't (and won't) know who the users are. On the sheet there is a command button that will save it to a folder also on their desktop. This folder ("Finished Work") will have the same name for all users. At the end of the day, when they return to the office, they will upload that folder to Teams. As you can see in my code example below we are all on a One Drive. I know the code to retrieve my own pathway to the folder i just can't seem to find a way to retrieve an unknown username to add into the save pathway.
Any help is always appreciated and thank you in advance if you try and help me!
Any help is always appreciated and thank you in advance if you try and help me!
VBA Code:
ChDir "C:\Users\My_Name\OneDrive - My_Company\Desktop" ' need to make this dynamic to any user - our format for "My_Name" is JSmith