LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Automated Printing

My colleagues at work regularly have a several hundred of Excel
spreadsheets that need Printing on either white paper or as PDFs. I
have created a user form, so that each team member can choose which
print method they want before printing. I have produced some VBA that
will then do the job automatically.

The code mostly works fine for printing paper copies. However each
person in the network has there printer set up differently. On one
machine the printer will be listed as "Brother HL-2460 series on Ne01:"
on another it will be "Brother HL-2460 series on Ne03:" etc. Could
someone tell me how to set things up, so that the setting is the same
for all people in my team. E.G. I would like it if the setting is
"Brother HL-2460 series on Ne01:" for everyone.
When printing PDFs I have the same problem. The active printer is
listed as "Adobe PDF on Ne03:", on another it may be "Adobe PDF on
Ne04:" etc.
A more serious problem is that the PDFs only print on the computer
where an early version of PDF writer is installed. I have found out
that a way round this problem is to get the macro to first write a
postscript file using the acrobat distiller, then convert the
postscript to a PDF. I found following code on the web:

Sub PrintPDF()

' 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
MySheet.Range("myRange").PrintOut copies:=1, preview:=False,
ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True,
prttofilename:=PSFileName

' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

End Sub

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
MySheet.Range("myRange").PrintOut copies:=1, preview:=False,
ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True,
prttofilename:=PSFileName

' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

End Sub

The above code looks like it will do fine. However when I go to file =
print in an excel document I do not get the option to set the printer
to "Acrobat Distiller". If I can't do the job manually, I can't get
the job done with a macro. Could someone help me set up the my system
so I can use the distiller in this way?

Thanks,

Andy.

 
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
Excel'03 - non printing help/hint automated messages working Excel Discussion (Misc queries) 5 July 25th 07 02:06 AM
Automated printing Newbeetle Excel Discussion (Misc queries) 2 September 24th 06 09:27 AM
Automated Printing Andy Excel Programming 0 May 24th 06 01:20 PM
Automated Dynamic Printing Area? smplogc Excel Discussion (Misc queries) 9 April 30th 06 05:13 PM
Automated Printing Brady Snow Excel Programming 1 October 29th 03 03:41 PM


All times are GMT +1. The time now is 02:46 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"