ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adobe PDF Writer error (https://www.excelbanter.com/excel-programming/281729-adobe-pdf-writer-error.html)

Lea

Adobe PDF Writer error
 

I recently installed Acrobat v6, and now I am having a
problem automatically converting files from Excel to PDF.
The line in question is:

ActiveSheet.PrintOut ActivePrinter:="Adobe PDF on NE00",
PrintToFile:=True, PrToFileName:="C:\Lea\a.pdf"

If I leave off the "PrintToFIle" and the "PrToFIleName",
then it seems to work, except that it prompts me for a
filename to save the pdf. If I try it as is, I get a
nasty error saying that either my port is set up
incorrectly, or I have run out of space.

Has anyone seen this? And does anyone have any
suggestions?

Thanks!

Dan E[_3_]

Adobe PDF Writer error
 
Lea,

I can remember having trouble's automating the PDF printing.
Though I can't remember exactly what they were. I found this
macro on somebodies site and it works well...

Private Sub CommandButton1_Click()
' Define the postscript and .pdf file names.
Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\myPDF.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

You can have it prompt for a save as name by changing
PDFFileName = "c:\myPDF.pdf" 'to:
PDFFileName = Application.GetSaveAsFilename

Dan E

"Lea" wrote in message ...

I recently installed Acrobat v6, and now I am having a
problem automatically converting files from Excel to PDF.
The line in question is:

ActiveSheet.PrintOut ActivePrinter:="Adobe PDF on NE00",
PrintToFile:=True, PrToFileName:="C:\Lea\a.pdf"

If I leave off the "PrintToFIle" and the "PrToFIleName",
then it seems to work, except that it prompts me for a
filename to save the pdf. If I try it as is, I get a
nasty error saying that either my port is set up
incorrectly, or I have run out of space.

Has anyone seen this? And does anyone have any
suggestions?

Thanks!




Dan E[_3_]

Adobe PDF Writer error
 
Shoulda mentioned,

This works on Acrobat 5. I can't guarantee it will on 6.
Watch out for word wrap on the posted code.

Dan E

"Dan E" wrote in message ...
Lea,

I can remember having trouble's automating the PDF printing.
Though I can't remember exactly what they were. I found this
macro on somebodies site and it works well...

Private Sub CommandButton1_Click()
' Define the postscript and .pdf file names.
Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\myPDF.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

You can have it prompt for a save as name by changing
PDFFileName = "c:\myPDF.pdf" 'to:
PDFFileName = Application.GetSaveAsFilename

Dan E

"Lea" wrote in message ...

I recently installed Acrobat v6, and now I am having a
problem automatically converting files from Excel to PDF.
The line in question is:

ActiveSheet.PrintOut ActivePrinter:="Adobe PDF on NE00",
PrintToFile:=True, PrToFileName:="C:\Lea\a.pdf"

If I leave off the "PrintToFIle" and the "PrToFIleName",
then it seems to work, except that it prompts me for a
filename to save the pdf. If I try it as is, I get a
nasty error saying that either my port is set up
incorrectly, or I have run out of space.

Has anyone seen this? And does anyone have any
suggestions?

Thanks!







All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com