using a shared printer (pdf)

S

steve

Below is the code I am using to print a worksheet to pdf, and save it, all in
vba. For this to work, I have to turn off the option that says: Do not send
fonts to "Adobe PDF". Is there a way to check this option with vba?

I have shared this printer across a network (all users running windows xp).
Then I shared the file containing the code below. when i run it from someone
else's computer, I get an error that there may be a firewall. What do I need
to do?

CODE:
Dim PSFileName As String, PDFFileName As String
Dim myPDF As PdfDistiller, x As String, y As String, wb As Workbook

Set wb = ActiveWorkbook
Application.ActivePrinter = "\\DANS\Adobe PDF on Ne05:"

If wb.Path = "" Then
MsgBox "this file has to be saved first"
Exit Sub
End If

x = ThisWorkbook.Path & "\Save Sheet as PDF" & "\"
y = Left(wb.Name, Len(wb.Name) - 4)

PSFileName = x & y & ".ps"
PDFFileName = x & y & ".pdf"

wb.PrintOut , prtofilename:=PSFileName
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

On Error Resume Next
Kill Left(PSFileName, Len(PSFileName) - 2) & "log"
Kill (PSFileName)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top