Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default excel/vba & acrobat 7.0 pro - Print multiple sheets to 1 PDF

Hi all,

I was wondering how i would go about modifying the code i have below so that
i can print multiple sheets to a single PDF file with each worksheet printed
being a different tab. (if that last part isn't possible, then 1 pdf file
with each page being a separate sheet from the workbook.)

Note: my workbook has 15 sheets, only 1 sheet is visible at a time. the
print function will unhide/hide the sheets so that they can be printed with
the code below. (not all 15 sheets will be printed to pdf, only 4)

here is the code i am using to print to a pdf file:

If printToPDF And (pageID(i) = "Invoice" Or pageID(i) = "Withdrawls" Or
pageID(i) = "Deposits" Or pageID(i) = "Sales Journal" Or pageID(i) =
"Summary" Or pageID(i) = "Inventory Costs") Then
pb.Caption3 = "Printing" & pageID(i)
Set myPDF = New PdfDistiller
PSfilename = path & "temp.ps"
If pageID(i) = "Invoice" Then
PDFfilename = path & order & ".pdf"
Else
PDFfilename = path & pageID(i + 2) & " " & Year(Date) &
".pdf"
End If
ActiveWindow.SelectedSheets.PrintOut copies:=1,
ActivePrinter:=ChoosePrinter(pdfPrinter), preview:=False, printtofile:=True,
collate:=True, prtofilename:=PSfilename
pb.Caption3 = "Converting to PDF...."
myPDF.FileToPDF PSfilename, PDFfilename, ""

Kill PSfilename
On Error Resume Next
Kill path & "*.log"
On Error GoTo 0
Set myPDF = Nothing
End If

i have tried printing each sheet to a .ps file and then using
mypdf.filetopdf to convert it, but i haven't been able to get it to accept
multiple input names.

If you need my entire printdocuments sub, let me know and i'll paste that

tia!
J
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
can you print format multiple sheets in excel at once? Rigatoni Excel Discussion (Misc queries) 7 September 10th 09 08:47 AM
can't print to adobe acrobat georgef Charts and Charting in Excel 2 July 4th 08 04:52 AM
Print multiple excel sheets in color Jorn Setting up and Configuration of Excel 1 June 29th 06 12:10 PM
Print to Adobe Acrobat (2 ws to one file) Michael McClellan Excel Programming 2 June 2nd 04 10:10 AM
Printing Multiple Sheets to Acrobat Distiller Kaval[_2_] Excel Programming 1 May 10th 04 11:20 PM


All times are GMT +1. The time now is 01:07 AM.

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"