Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Add sheet to existing Excel file

JamesG21
6 - Meteoroid

Hello Everyone,

 

I have over 100 files, each with one tab, saved to my desktop and I need to add a second tab to each file. Basically, I have 100 surveys and need to add an instructions page to each survey. I have tried using macros, but no luck. Another problem I'm having is the formatting. I want the surveys and instructions to maintain its original formatting. I'm not sure if this is possible, but I ultimately need 100 separate files (surveys) with two tabs. One tab being the original survey and the second tab being the instructions. 

 

Thanks,

James

5 REPLIES 5
binuacs
21 - Polaris

@JamesG21 One way of doing this is with the Block Until Done tool. Attaching a sample workflow for your reference

 

binuacs_0-1681454366259.png

 

 

 

mceleavey
17 - Castor
17 - Castor

Hi @JamesG21 ,

 

As you are adding a sheet to an existing workbook you actually don't need to open the existing sheets or load them into Alteryx.

 

I have attached a simple method of simply pulling in the metadata of those existing files, appending an instruction sheet to them, creating the fullpath with the new sheet in those Excel files then writing them out.

 

mceleavey_0-1681473405440.png

 

 

To do this, I used the Directory tool to read in the metadata, which gives you the full path of every file:

 

mceleavey_1-1681473106540.png

This allows me to then append the instruction sheet to these records:

 

mceleavey_2-1681473141753.png

Then I simply create the new tab name in a formula tool:

mceleavey_3-1681473178587.png

mceleavey_4-1681473192714.png

In the output, configure the actions at the bottom left as follows:

 

mceleavey_5-1681473226206.png

 

This allows Alteryx to loop through each record adding the Instruction page.

No Block Until Done required.

This creates the new Instructions sheet on as many sheets as you need. 

mceleavey_6-1681473322935.png

 

 

I hope this helps,

 

 

M.

 

 

 

 



Bulien

JamesG21
6 - Meteoroid

Thanks Binuacs and Mceleavey!

 

Mceleavey I tried your solution, but I'm still having trouble adding the instructions. The instructions are in a separate Excel file, so I replaced the Text Input tool with an Input tool. I'm able to add an instructions tab to my surveys. However, the instructions tab is blank and the file gets corrupted. I'm not sure what I'm doing wrong.

 

Thanks,

James

JamesG21
6 - Meteoroid

Thanks Mceleavey!

 

I tried your solution, but I'm still having trouble adding the instructions. The instructions are in a separate Excel file, so I replaced the Text Input tool with an Input tool. I'm able to add an instructions tab to my surveys. However, the instructions tab is blank and the file gets corrupted. I'm not sure what I'm doing wrong.

 

Thanks,

James

JamesG21
6 - Meteoroid

I included sample data. I'm trying to add the instructions tab to each survey. 

Labels