Accurate PDF printing from Excel

JJ

New Member
Joined
Feb 18, 2002
Messages
7
A little while ago I needed to automate printing PDF files from Excel giving each PDF a filename which was sourced from cell A1. The final code which I used if anyone is interested was as follows (the file path and file name are stored in cell A1 for example c:XXXXXX.pdf where Cell A1={XXXXXX} simple to do with a concatenate function).

Dim PDFFileName As String
Application.ActivePrinter = "Acrobat PDFWriter on LPT1:"
Range("A1").Select
Let PDFFileName = Application.ActiveCell
SendKeys PDFFileName & "{ENTER}", False
ActiveSheet.PrintOut
PSFileName = Chr(34) & PDFFileName & Chr(34)


However, when you print a sheet with embedded charts from Excel via PDF Writer in the Print menu (as above) the final PDF is far from perfect (lines move strangely around and bar labels are offset etc.)

A far better and more accurate solution is to actually click the ICON PDF Maker 5 for Excel in the Menu bar and go through the distillation process in full (in this case the PDF Maker states the file should be saved before it can continue etc.).

Is there a way to undertake the last ‘ICON approach’ through VBA, again, selecting Cell A1 as the PDF name?? I tried to record a macro and go through the ‘ICON approach’ but all the VB editor shows after the process is blank…..

I’ve had a look at http://www.pdfstore.com/mainpage.asp?WebPageID=227 and can’t find any good help.


Any comments would be gratefully appreciated!!

JJ
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
i would suggest acrobar full version not reader versions 4 but v5 has a button to convert without V4 using distiller...
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,739
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top