View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] douglascfast@hotmail.com is offline
external usenet poster
 
Posts: 19
Default Excel sheet to PDF Macro = security question

Tom,

I do not have that set up. But I dont see how I would set the
distiller as a printer. Waht I have is the Adobe PDF as a printer (and
my bad for not posting the one I am working with) is
ActivePrinter:="Adobe PDF on Ne01:"

This is in my print list. But the code fails on the lines
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller

If I am not in an admin setting.

Do I need to set up something for the distiller?

Doug



Tom Ogilvy wrote:
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