Refresh Data Macro in Excel Not Working

I have a problem, when get refresh data query in excel file with macro. Robot is successfully to run this project but this Excel Data not updated (Macro for refresh VBA in excel not working).

there are the syntax of macro / vba :

Sub macro1()
ActiveWorkbook.RefreshAll

End Sub

But when i try to run this macro by manual (not from robot) this is successfully

Thanks

Hi @Nur_Zain_Pradana

Can you please check if access is given in the excel to run the macro in the Robot Machine?
Head to excel, on Home page click on Options:
image
Click on Trust Center
image
Click on Trust Center Settings
image
Click on Macro Settings and enable these two.

And try running the code again.

Happy Automation!! :smiley:

i was doing that, in trust centre setting. but it same.

how about this properties of Execute Macro ?

this is a setting of trust centre

Is this file in vFileDB a .xlsm file?

Alternative that you can try is

Use Invoke VBA activity
store your macro code in a .txt file in your project folder
and use the invoke vba activity:
image

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