Alteryx Designer Desktop Discussions

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

Python Macro - Excel to PDF Converter Part 2

taylormgruendel
7 - Meteor

Hi all! 

 

I've been working with this Python Macro workflow that was populating the PDFs I wanted, but now it's no longer creating PDFs even though I'm not encountering any errors. Does anyone know what the problem may be? (I've checked all the file paths and they all seem to be correct)

 

Thank you!

5 REPLIES 5
PhilipMannering
16 - Nebula
16 - Nebula

I noticed that the Formula Tool calculates [filename] which tries to add a string and numerical value [f1_01]. After making [f1_01] a string I did get two PDFs output for the two records.

 

The second PDF was corrupt. I believe this is because the data values for the checkboxes were blank (where in fact the values should be "/Off" or "/Yes"

TH
8 - Asteroid

I tried to get started with this and immediately ran into an issue with not having the same virtual environment.

Did anything happen to change the virtual environment you're using?

 

Does anyone else use this macro? You might talk to that person and see whether they are having the same issue.

taylormgruendel
7 - Meteor

Hey @PhilipMannering,

 

Thanks for the quick response! On our side, [f1_01] is set to a string already, and we double checked all of our absolute and relative paths. Do you know what else it could be?

PhilipMannering
16 - Nebula
16 - Nebula

Hi @taylormgruendel 

 

It looks like the bulk of the code is within a `try except` block. Which means any (ugly) errors are hidden. I would go to the workflow configuration pane > Show all macro messages,
image.png
 

Then rerun the workflow and look at the log messages. You may see the exact error... like "unable to open file ... because somebody has it open" .

image.png

 

Hope this helps.

taylormgruendel
7 - Meteor

Hi @PhilipMannering 

 

It populated this message - Info: f1042s_filler (36): Record #1: Tool #5: AYX_PDF_form_fill() catch :  FileNotFoundError(2, 'No such file or directory')

 

Looked back at my Formula tool and realized the file paths were not generating a '\' before the pdf file, it works now! Thank you for your help :)

Labels