Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Dynamic Rename a formatted file using Run Command

Denisa_Grecu
8 - Asteroid

Hello,

 

I have the following situation:

1. I copy and paste from a different directory to my work directory a file with the original formatting and containing a vba macro - for which I use the prompt command tool;

2. I work the file in different containers which will overwrite some existent sheets in the copied folder + will create some non-existent sheets.

Step  1 and 2 work perfectly.

3. I need to rename the worked file using the original formatting + the new attached sheets + containing the original macro - I tried to do it though run command again (under the formula 'copy " ' + [User.LocalPath]+"\"+[FileName]+' " '+ ' " '+[User.LocalPath]+"\"+[New File Name]+' " '). This workflow will run everyday and the name will always change and for example this will add a "RECON" part to its name to be able to differentiate it, for eg:"20230424_074205903_Z41102_DEC" will be called "20230424_074205903_Z41102_DEC - RECON". I tried in many ways to solve this in order to have the disired output, but none worked:

 

a). I tried to have it in a separate container at the end using an automatic input doing the same thing, but it runs in the middle of the first part of the workflow (and this should be the end point), although using a blocking tool.

Denisa_Grecu_0-1682337766595.png

 

b). I created a bat file linking the command run to the last sheet created so I can rename using the initial file formatting - but I am having an error regarding the run command.

 

c).I created a bat file with the renaming code in prompt command but this will be outputted in a bat file (in a specific directory) and then will be triggered in the events as per the attached prints:

Denisa_Grecu_1-1682337521236.png

 

Denisa_Grecu_1-1682336941954.png

The error that gives:

Denisa_Grecu_0-1682336887093.png

 

Also, although I am trying to solve it this way, I am not sure that the formatting will be kept in the case of b). and c).

 

Do you have any solution for my issue?

 

Please note that I cannot attach the workflow as it is a big one.

 

Best regards,

Denisa Grecu

5 REPLIES 5
Clifford_Coon
11 - Bolide

Hi @Denisa_Grecu ,

 

Here's what I do:

1. use Blob copy to copy and rename file first.

2. use the original input for calculation (I'm updating a template file)

3. Output to the already renamed file.

 

If this doesn't make sense, let me know & I can add an example.

ArnaldoSandoval
12 - Quasar

Hi @Denisa_Grecu 

 

I posted no long ago a workflow to: (1) copy an Excel template with new name (static new name)  (2) Add data to the new Excel file and (3) run a macro inside the Excel file; in the particular example the macro protect some areas of the Excel workbook; the key for this workflow model to work is the Block Until Done tool, this tool should manage the streams as done in the solution I posted at Locking columns in excel output 

 

I attached here the Protect_Excel_01 workflow, hoping it helps you to manage your challenge; I noticed you are using workflow events, my solution trigger the batch files with more control, as we do not know if Alteryx will run both batch files simultaneously. 

 

hth

Arnaldo 

Denisa_Grecu
8 - Asteroid

Hello. 

 

I never used the blob tool. Would you mind give me an example?

Clifford_Coon
11 - Bolide

He is an example from another topic.,

 

IT's a macro that's included in the attached workflow, showing a copy / Update process.

 

Annotation 2023-04-21 102605.jpg

Bluebird_Tim
7 - Meteor

@Denisa_Grecu  if you haven't upgraded to 23.1 - Some of this may be solved with control containers

Labels