Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default using a shared printer (pdf)

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)
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
Issues with shared vs. non-shared formulas on somewhat wide spreadsheets david.karr Excel Discussion (Misc queries) 0 August 16th 07 12:52 AM
members on my network printer not able to print to default printer smeheut Excel Discussion (Misc queries) 0 June 18th 07 06:42 PM
Printing viewing a shared workbook on a shared drive aloomba Excel Discussion (Misc queries) 0 April 13th 07 02:52 PM
Printer Multiple Worksheets with a particular Printer Setting PP[_2_] Excel Worksheet Functions 0 March 14th 07 02:02 PM
Send printer escape commands to a printer using VBA mikeburg[_41_] Excel Programming 3 October 6th 05 07:36 PM


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