View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Excel sheet to PDF Macro = security question

do you have distiller defined as a printer under the ID that fails?

If so, select it manually.

then in the immediate window in the VBE do

? Application.ActivePrinter
and see what the string is. Does it match your code?

--
Regards,
Tom Ogilvy



" wrote:

All,

I found this piece of code on the group:

Sub PrintPDF()

Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "D:\MyDoc.PS"
PDFFileName = "D:\MyDoc.pdf"

' Print the Excel range to the postscript file
Dim MySheet As Worksheet
Set MySheet = ActiveSheet

MySheet.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, ""

End Sub

This runs fine under Admin permissions. BUt does not under a users. I
have granted full read / write access to the folder where Adobe sits,
but with no luck.

Can someone tell me how the distiller works and what permissions the
user would need to execute this?

Doug