Alteryx Designer Desktop Discussions

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

Output Password Protected XLSX macro with dynamically changing name (today's date)

DigitalPlumberDave
6 - Meteoroid

Hi everyone,

 

As a new user who found no password protection/encryption for outputs a little disappointing, I was quite pleased to find this macro by Ben Moss that can apply a password to your xlsx output. 

 

Question for you, how would I deal with a file name that changes based on today's date?

I output an xlsx file with today's date in the name. For example, my current file name defined in the macro question is "test", but I need it to match what is dynamically generated by the output tool in the previous step, for example "test - 2020-11-20" today.

 

How can I feed that dynamically changing name into the macro?

 

See example workflow.

 

Thank you

5 REPLIES 5
AkimasaKajitani
17 - Castor
17 - Castor

Hi @DigitalPlumberDave 

 

I recommend when you upload the workflow that contain any macros, you might export "yxzp" file by "Export Workflow" and upload it. Because the when anyone download it, he don't have the macro, then the macro is missing(please refer the below image).

 

AkimasaKajitani_2-1605832831678.png

 

Fortunately I have the Output Password Protected XSLX macro.

 

Back to the original story.

You have to use Batch Macro that overwrite the filename dynamically.

 

Workflow:

AkimasaKajitani_5-1605835428618.png

 

 

BatchMacro:

AkimasaKajitani_3-1605835290819.png

The Action tool connected Parameter control overwrites "FilePath".

AkimasaKajitani_4-1605835402796.png

 

Please refer attached workflow.

Please reply to me if you have any questions.

 

My Alteryx designer version is 2020.4, so I overwrite version info of the workflow into 2019.3.

If attached workflow is not work, please tell me.

 

DigitalPlumberDave
6 - Meteoroid

Hi @AkimasaKajitani

 

Thank you very much. I got it to work.

 

As you can see I have a fair bit to learn, so I appreciate your tips and teaching me a bit more about macros. I must admit, that is the part of Alteryx I know the least of. 

AkimasaKajitani
17 - Castor
17 - Castor

Hi @DigitalPlumberDave 

 

I'm glad it worked out well.

 

You may use Interactive lesson about Macro to more learn it.

https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons

 

AlexAung
6 - Meteoroid

Hi @AkimasaKajitani, I am getting the below error message when I tried to use your workflow for custom file name. Original file and macro from Ben Moss has no issue. Please help.

 

Working directory is c:\temp and I downloaded all files to that folder.

 

error.JPG

AkimasaKajitani
17 - Castor
17 - Castor

Hi @AlexAung 

 

Can you share the macro setting?

 

I doubt that the setting "File Name" of macro is wrong from this result "C:\temp\C:\temp\"

 

AkimasaKajitani_0-1658835756076.png

 

FileName field should be set "Subject" field made at the previous formula tool.

 

AkimasaKajitani_1-1658836522885.png

 

Labels