How to loop through several excel files and refresh them with Macro

I would like to refresh my excel files with the Macro function in uipath. how to build that?

image

Hi @Nightowl_music

Please use the below code.

Sub Workbook_RefreshAll()
ActiveWorkbook.RefreshAll
End Sub

Refer the below link

Regards

1 Like

i need to resfresh 5 different excel files. i know to code. i need to know how to loop these with macro

Hi @Nightowl_music

Directory.GetFiles(“Youfilepath”,"*.xlsx")

Loop through the files.

Use excel appliction scope and pass the looped files.

Use exceute macro.

Refer the screenshot below.

Regards

Hi @Nightowl_music

Is it worked for your case?

Regards

yes but still have problem with the password.

I tried also with type into function , but did’t work

Hi @Nightowl_music

Try with connect activity from the Database activities.

Odbc 32 /64 bit installed on your machine.

Regards

thanks, but no idea how to build this

Hi @Nightowl_music

Can you send me screenshot of your workflow?

Regards

Hi @Nightowl_music

Refer to the below thread.

Regards

There is a code to write password and username with VBA. You can write the code in your macro. I don’t have the link but you can search for it. It could help you.

Please check also this channel to learn more about some function in UiPath:

Best regards
Mahmoud