Print2PDF with "ChartTitle" as name
SpeeD72,
Following is a macro to print to pdf however you like.
I will take no credit for the code (I found it at someones
website but don't quite remember whos???). You need
to add references to "AcrobatPDFMaker" and
"AcrobatDistiller" to your project.
Sub Print_PDF()
' Define the postscript and .pdf file names.
Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\ChartTitle.pdf"
' Print the Excel range to the postscript file
Dim MySheet As Worksheet
Set MySheet = ActiveSheet
ActiveSheet.PrintOut copies:=1, preview:=False, _
ActivePrinter:="Acrobat Distiller", printtofile:=True, _
collate:=True, prtofilename:=PSFileName
' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""
Kill (PSFileName)
End Sub
It creates a PDF just as if you chose to print to PDF
(ie printing boundries)
Dan E
"SpeeD72" wrote in message ...
Hi guys.
I need to print a sheet that contains a Graph (pie), and
the respective values (tabel) to PDF, to be used in other
programs. It´s essecial that the name of the PDF is
the "ChartTitle", and this as to be autumatic, becouse
theres a lot of PDF´s to be made...
Thanks a lot!!!!!!!!!
SpeeD72
P.S: i use PDF becuuse it retains the objects
as "curves", and can be used in other Design progs.
|