Hello,
I now there was much entries over this theme.
I selected the way over Distiller and PS-File.
The Code see below or in Forum
http://p2p.wrox.com/archive/vba_excel/2002-11/37.asp
I activated the Distiller library
and checked off the "Do not send fonts to Distiller" option.
It works correct until it comes to the Line
Set myPDF = New PdfDistiller
then it breaks with error 429 -can not creat object through Active-X component - or like that. (I do not have the original english message syntax - only in German language)
I activated following additional Libraries:
-
VB for applications
- MS Excel 9.0 Object Library
- MS Forms 2.0 - " -
- MS Office 9.0 - " -
- MS DAO 3.6 - " -
- MS Outlook 9.0 - " -
- OLE Automation and last but not least
- Acrobat Distiller
My Versions are Excel 2000 and Acrobat 5.0
I have no more ideas to solve that problem.
Can somebody help me? Thanks!
'***********************************************
' Define the postscript and .pdf file names.
Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "d:\temp\myPostScript.ps"
PDFFileName = "d:\temp\myPDF.pdf"
' Print the Excel range to the postscript file
Dim MySheet As Worksheet
Set MySheet = ActiveSheet
MySheet.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, ""
***