Open CSV file in Dynamic Folder

Hi!

How can I open a csv file in a dynamic folder?

The idea is I will send my project to my colleague but the path will change on his machine. Please see sample below.

My Machine Path will be:
“C:\Users\MyName\User Info.csv”

His Path:
“C:\Users\HisName\User Info.csv”

Now im thinking if he execute the project in his machine it will give an error.

Please help.

Thank you.

Hi,

This will give your the current logged in user name,

"C:\Users"+Environment.UserName+ "\User Info.csv”

2 Likes

“C:\Users"+System.Environment.MachineName+"\User Info.csv”

1 Like

Even we convert this code to get desired output, it will give the machine name only I guess.

“C:\Users" + System.Environment.MachineName +”\User Info.csv", but @criskitz looking for user directory from Users path.

It works! thanks you are awesome!