Alteryx Designer Desktop Discussions

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

List the Excel Worksheet Names with a Batch Macro

Hiblet
10 - Fireball

I have a very simple Batch Macro, attached.  This is intended to take a Control Parameter (a full file path) and get the Excel Sheet names.

 

The idea is that I can push a lot of Excel full file paths to the macro, and it will list out the Sheet names.

 

For some reason the macro stops after the first iteration, and I don't understand why.

13 REPLIES 13
joshuaburkhow
ACE Emeritus
ACE Emeritus

Wondering why you would need this as there is already a tool that does this 😉 ..... Dynamic Input Tool

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
JosephSerpis
17 - Castor
17 - Castor

Hi @Hiblet the marked solution on this post might help you.

Hiblet
10 - Fireball

Hi @joshuaburkhow , this is just the start point for a something that will try to find some particular sheets and try to pull each one in.  They are potentially all sorts of formats.  Think Dynamic Input with variant schemas.  But, having fallen at the first hurdle, I have to wind my neck in a bit!

Hiblet
10 - Fireball

Hi @JosephSerpis , that is helpful, but not what I am looking for.   I am not so much looking for the solution, as for understanding as to why my batch macro runs just one iteration.  From my understanding, the macro should step through each input, get the sheet names, and output all the sheet names for the files, but it runs one iteration and stops.  Thanks for the reply though.

JosephSerpis
17 - Castor
17 - Castor

Hi @Hiblet I ran your macro it's working as expected in the below screenshot I fed in two excel files each having 3 sheets hence why I have six records.

 

Test_09102020.JPG

Hiblet
10 - Fireball

Hi @JosephSerpis , that is weird, I get the macro stopping after one iteration on my machine.  The two attached JPEGs show the yxdb that I push into the macro (list of 3 files) and the other shot shows the feedback from the run.  I have attached the XLS sheets, they are just simple place holder fakes, not actual sheets with useful data. 

JosephSerpis
17 - Castor
17 - Castor

Hi @Hiblet those files work for me again with your original macro.

 

Test_09102020_V2.JPG

Hiblet
10 - Fireball

Hi @JosephSerpis , Gosh that is weird.  I re-started my Alteryx and I still get the same behaviour.  I am on 2020.2 .   What could be environment specific like that??

JosephSerpis
17 - Castor
17 - Castor

Hi @Hiblet what is the output from the YXDB from your screenshoot because if it was the same file but repeated in three rows that would explain why it's iterating only once. 

Labels