Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

How to refresh the Excel data Using Alteryx?

Gaurav0001
8 - Asteroid

Hello,
I need help to find ,
How can I refresh data (Analysis >> Refresh All) on Excel file using Alteryx and after refresh completes, it should save on the same file.

Thank You in Advance.

6 REPLIES 6
flying008
15 - Aurora

Hi, @Gaurav0001 

 

1- If you want to refresh all data of excel file before input, you need use event.

2- If only want to refresh data in wf, you need use Run-Command tool.

3- All both method use powershell code to get function.

4- The code like below, you need change some line:

$objExcel = New-Object -ComObject Excel.Application

$objExcel.Visible = $false

$workbook = $objExcel.Workbooks.Open('D:\your path\abc.xlsx')

$objExcel.ActiveWorkbook.RefreshAll()

$workbook.Save()

$objExcel.Quit()
Gaurav0001
8 - Asteroid

Can you make a workflow that perform the task (Refresh All data) as you said.

That will be more helpful.

 

Thank You. 😁

flying008
15 - Aurora

Sorry, I can't upload any .yxmd file to here, but the all code as above for you.

Aayush161
5 - Atom

Hi , I am trying to use this code and run in my workflow using the run command tool but i am not able to figure out the steps of how to save and file and how to configure the tool 

can you please help me with it 

 

aseeling
5 - Atom

Thank you, this worked for me.

azamora
5 - Atom

Would the code work on an output file too? 

Labels
Top Solution Authors