Excel allow user to change environment

Hello. I would like to ask how to allow users on different computers to write down their excel file path in excel, so that they can still run the robot that we shared.
Thank you

Hi @CHAN_Hiu_Fung_Victor_Stud

Welcome to UiPath community

You can try with the belwo expression

Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)+"\Downloads" 

Environment.ExpandEnvironmentVariables("%USERPROFILE%\Downloads")

Regards
Gokul

Hi @CHAN_Hiu_Fung_Victor_Stud

In your computer the excel file path is with your user Id like below
“C:\Users\mahesh\Downloads\Book1.xlsx”
In the above my user Id is mahesh. In that place use the Environment.Username function.
“C:\Users"+Environment.Username+”\Downloads\Book1.xlsx"

The Environment.Username will take the environment username of the computer where we run the bot.

Hope it helps!!

Hi @CHAN_Hiu_Fung_Victor_Stud ,
file path in other PC is different,
you should create input and output folder in folder of source code → they will be similar in all PC
we can use “\input..etc”, “\output..etc”
regards,

Sorry. Can I do it by using any activity in UiPath? As I am not familiar with coding.

Sorry, but where can I type this expression

If you need to read the Excel file, thenpaste the following code into the ‘Read Range’ activity.

Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)+"\Downloads"

Regards
Gokul

1 Like

When you create folder manual where create project-> similar with all PC
image

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.