Skip to main content

I have created a bot that prints an excel sheet to PDF and in doing so saves the excel as a PDF document. It is working fine and I can manipulate the excel data and loop through to save different PDF files. However, the PDF output is 0KB when run through the bot and I can’t open it. When I try to replicate the exact same keystrokes myself, the correct file size is generated and I can open it as expected.

When it comes to printing, I get a window pop up saying ‘Printing Now Printing “nMy excel sheet name]’ on the Microsoft Print to PDF on’ open briefly then a Microsoft dialogue box where I type my File name and hit save. In the bot, the file name is added using keystrokes.

When I type the name manually, I can then see the ‘Printing’ pop up change to ‘1 of 4’ pages, ‘2 of 4 pages’, then it closes. However, when the bot runs through, types the file name and hits Enter to save, the popup disappears immediately, which suggests it’s not saving to PDF properly.

Please advise?

There are two controls that overlap in the filename area. One is a drop-down, one is a text box. Make sure you’re capturing the correct control. It’s easy to get the wrong one.

Text box
Drop-down list box

 


Reply