Hi All,
I am writing a marco to convert an excel sheet to a pdf. I have looked at similar threads here and have nearly got it working however it is crashing on the last line with the error "Runtime error 429 Active X component cant create object." My understanding is that I dont have the correct dll registered an hence its the macro is not working. Is the so and what do I need to do to get this to work? I am using Acrobat 5 and Excel 2002. Thanks in advance!
Private Sub CommandButton1()
' Define the postscript and .pdf file names.
Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "I:\PERFORM\Personal\Andre
w\Pulse_La
dder_MB.ps
"
PDFFileName = "I:\PERFORM\Personal\Andre
w\Pulse_La
dder_MB.pd
f"
' Print the Excel range to the postscript file
Dim MySheet As Worksheet
'MySheet = sT25MB
Set MySheet = ActiveSheet
MySheet.Range("A1:I31").Pr
intOut 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, ""
End Sub
Start Free Trial