Creating PDF File from Excel using VBA Script - Adobe Acrobat Windows. I have Excel 2000 and Adobe Acrobat v6.0 Standard. I'm trying to use a Visual Basic for Applications (VBA) macro to output reports to PDF files. I'm using Excel 2010 and have Adobe Reader 11. Print a PDF file using VBA Clone your printer and set the print properties to suit and set that printer as the. Vba Macro To Print To Pdf Via Specific Printer - I am trying to print to a PDF file from Excel which. - Free Excel Help. VBA, Excel, Printing to PDF I would like to automate the process of printing a excel worksheet to a pdf with a certain naming convention and file name. Currently I'm using the following code. Excel General; VBA to print PDF's in A3 size. Of the Printer back to A4. First, Excel VBA has the ability to change paper sizes if the printer driver cooperates.
I am working on a series of XLS files in Excel. When I am done with them, I need to print them to PDF so that they can be transmitted to a party outside my firm.
I recorded a fairly basic macro to allow me to print these files with the same setting every time. Unfortunately, it is not doing everything I need it to do.
Basically, I want Adobe to ask me where the file should be saved when it's being printed. That is not taking place right now with my script. If I manually print and select the settings 'Ask to replace existing PDF file' from the Printer Properties window in Excel, it always asks me where the file should be saved. My script is not catching this, however, and I'm not sure what I need to add.
I have a lot of files to go through (and this is a task that will recur) so the sooner I get this nailed down the better.
Is this something that I can address with my Excel macro, and if so, can anyone point me in the right direction?
As the title suggests... I'm looking to expand my automating to include directly printing to PDF. The macro(s) I have written already formats the print area and page setup as I need it. But when I go to record my macros nothing for printing, changing printers or saving to file is captured.
Is there a way to accomplish this? I could even get by if it just required a save location prompt. The file name I would imagine could be auto-generated by grabbing existing info within the spreadsheet.
if you are using Excel 2010 and above, then Excel provides you with in internal add-in which allows you to save the file as PDF format.
Use the following code in your macro to save your file as PDF
Here you can replace the path C:Users46506090DesktopBook1.pdf and file name to your liking.
Edit: If you intend to publish the entire workbook as PDF and not just the sheet you are working on just replace ActiveSheet.ExportAsFixedFormat to ActiveWorkbook.ExportAsFixedFormat