Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lea Lea is offline
external usenet poster
 
Posts: 4
Default 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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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!





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CD Writer Zygy[_3_] New Users to Excel 1 October 30th 07 05:32 PM
Adobe inserting into Excel causing the adobe file to be low dpi Chronic Excel Discussion (Misc queries) 0 April 25th 07 10:16 AM
PDF writer TomBeard Excel Discussion (Misc queries) 7 January 11th 07 03:15 PM
how to re install Adobe Acrobat in Excel? The adobe Acrobat work. Execl error Excel Discussion (Misc queries) 1 March 17th 05 02:29 AM
Cheque Writer in Excel Praveen Excel Programming 1 October 28th 03 03:06 PM


All times are GMT +1. The time now is 09:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"