ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating PDF files via 995 (https://www.excelbanter.com/excel-programming/443572-creating-pdf-files-via-995-a.html)

Pete[_34_]

Creating PDF files via 995
 
Hi all

I have PDF creator 995

I would like to automatically create a pdf file off an Excel* quote sheet
If I use:
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:="PDF995
on Ne00:", Collate:=True
it asks for the name of the file (and directory). It works but I don't want
to have to set the directory, type in the quote number and customer each
time

When I changed the line to the one shown below it creates a file with a pdf
extention in the correct directory but is not a readable pdf form (either
not supported file type or damaged)

Sub CreateQuotePDF()
Dim PDFFileName As String
Sheets("Quote").Select
PDFFileName = Range("Quote_Directory") & "\" & Range("Quote_Number") &
" - " & Range("Guest_Name") & ".pdf"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:="PDF995
on Ne00:", printtofile:=True, Collate:=True, prToFilename:=PDFFileName
End Sub

* Excel version 2002

What am I doing wrong?

Thanks in anticipation

Regards
Pete

Email:


Pete[_34_]

Creating PDF files via 995
 
I had no replies to my query so assume it can't be done :-(

So decided on a compromise: To write the info (e.g. C:\Users\Public\Heavenly
Holidays\Quotes\1503 - 2 Stafford Close - Nicolene Moodley.pdf) to the
clipboard and then simply paste it in on the file name bar when it comes up.
It includes a full path so places the file in the correct directory. an
adequate work-around. :-)

Sub CreateQuotePDF()
Dim PDFFileName As String
Dim ClipData As DataObject
Set ClipData = New DataObject
Sheets("Quote").Select
PDFFileName = Range("Quote_Directory") & "\" & Range("Quote_Number") &
" - " & Range("Unit_Name") & " - " & Range("Guest_Name") & ".pdf"
ClipData.SetText PDFFileName
ClipData.PutInClipboard
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:="PDF995
on Ne00:", Collate:=True
End Sub

Regards
Pete

Tel : Margate 03931 22334
Cell : 083 233 1628
Email:

"Pete" wrote in message
...
Hi all

I have PDF creator 995

I would like to automatically create a pdf file off an Excel* quote sheet
If I use:
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:="PDF995
on Ne00:", Collate:=True
it asks for the name of the file (and directory). It works but I don't
want to have to set the directory, type in the quote number and customer
each time

When I changed the line to the one shown below it creates a file with a
pdf extention in the correct directory but is not a readable pdf form
(either not supported file type or damaged)

Sub CreateQuotePDF()
Dim PDFFileName As String
Sheets("Quote").Select
PDFFileName = Range("Quote_Directory") & "\" & Range("Quote_Number") &
" - " & Range("Guest_Name") & ".pdf"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:="PDF995
on Ne00:", printtofile:=True, Collate:=True, prToFilename:=PDFFileName
End Sub

* Excel version 2002

What am I doing wrong?

Thanks in anticipation

Regards
Pete

Email:






All times are GMT +1. The time now is 06:11 PM.

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