PC Review


Reply
Thread Tools Rate Thread

Addobe PDF printer

 
 
joeeng
Guest
Posts: n/a
 
      30th Jun 2009

I am executing the following prrocedure which is located in a standard module
to get Adobe PDF to generate a postscript file. When I call this procedure
from a worksheet module it executes perfectly. When I call it from a
userform module, it crashes with the error "When you create a postscript
file, you must rely on System fonts and use document fonts" and creates an
empty postscript file. It should be calling the same print driver in both
cases, but apparently is not. Does anyone know how to correct this? Am I
missing a qualifier?

Sub Printworkbookpdf()

Dim myprinter As String

myprinter=Application.ActivePrinter
Worksheets("Cover").Select
ActiveSheet.PrintOut Preview:=False, ActivePrinter:="Adobe PDF",
PrintToFile:=True, PrToFileName:=psFileName
Application.ActivePrinter=myprinter

End Sub
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      1st Jul 2009

If you are calling the posted sub in both cases, there should be no
difference in the result. The culprit would have to be in the set up prior
to calling the print sub.


"joeeng" <(E-Mail Removed)> wrote in message
news:387EA1B7-839B-4290-B8B7-(E-Mail Removed)...
>I am executing the following prrocedure which is located in a standard
>module
> to get Adobe PDF to generate a postscript file. When I call this
> procedure
> from a worksheet module it executes perfectly. When I call it from a
> userform module, it crashes with the error "When you create a postscript
> file, you must rely on System fonts and use document fonts" and creates an
> empty postscript file. It should be calling the same print driver in both
> cases, but apparently is not. Does anyone know how to correct this? Am I
> missing a qualifier?
>
> Sub Printworkbookpdf()
>
> Dim myprinter As String
>
> myprinter=Application.ActivePrinter
> Worksheets("Cover").Select
> ActiveSheet.PrintOut Preview:=False, ActivePrinter:="Adobe PDF",
> PrintToFile:=True, PrToFileName:=psFileName
> Application.ActivePrinter=myprinter
>
> End Sub



 
Reply With Quote
 
joeeng
Guest
Posts: n/a
 
      1st Jul 2009

The font setting is setup to use document fonts. Seems to me that I remember
from somewhere that the userform module is an application level module.
Would that affect the default location it searches for the printer? Perhaps
the network level rather than the local level for the userform call? If so,
I would have to tell it to only search the local printers.

"JLGWhiz" wrote:

> If you are calling the posted sub in both cases, there should be no
> difference in the result. The culprit would have to be in the set up prior
> to calling the print sub.
>
>
> "joeeng" <(E-Mail Removed)> wrote in message
> news:387EA1B7-839B-4290-B8B7-(E-Mail Removed)...
> >I am executing the following prrocedure which is located in a standard
> >module
> > to get Adobe PDF to generate a postscript file. When I call this
> > procedure
> > from a worksheet module it executes perfectly. When I call it from a
> > userform module, it crashes with the error "When you create a postscript
> > file, you must rely on System fonts and use document fonts" and creates an
> > empty postscript file. It should be calling the same print driver in both
> > cases, but apparently is not. Does anyone know how to correct this? Am I
> > missing a qualifier?
> >
> > Sub Printworkbookpdf()
> >
> > Dim myprinter As String
> >
> > myprinter=Application.ActivePrinter
> > Worksheets("Cover").Select
> > ActiveSheet.PrintOut Preview:=False, ActivePrinter:="Adobe PDF",
> > PrintToFile:=True, PrToFileName:=psFileName
> > Application.ActivePrinter=myprinter
> >
> > End Sub

>
>
>

 
Reply With Quote
 
joeeng
Guest
Posts: n/a
 
      17th Jul 2009
After a great deal of experimentation, it turns out the problem has nothing
to do with being called from a userform. Apparently, once a BeforePrint
event procedure is called, and the Cancel is set to true, the Adobe PDF
printer will not work anymore until the Excel session is closed and Excel
reopened. Even if the BeforePrint event procedure is called again and the
Cancel is set to false, the Adobe PDF printer will not work. So Adobe PDF
printer will work up until the BeforePrint event procedure sets the Cancel to
true. I don't know if this is an Excel issue or an Adobe issue, and I have
not been able to find a work around. Hope this helps other Adobe PDF printer
users.

"joeeng" wrote:

> The font setting is setup to use document fonts. Seems to me that I remember
> from somewhere that the userform module is an application level module.
> Would that affect the default location it searches for the printer? Perhaps
> the network level rather than the local level for the userform call? If so,
> I would have to tell it to only search the local printers.
>
> "JLGWhiz" wrote:
>
> > If you are calling the posted sub in both cases, there should be no
> > difference in the result. The culprit would have to be in the set up prior
> > to calling the print sub.
> >
> >
> > "joeeng" <(E-Mail Removed)> wrote in message
> > news:387EA1B7-839B-4290-B8B7-(E-Mail Removed)...
> > >I am executing the following prrocedure which is located in a standard
> > >module
> > > to get Adobe PDF to generate a postscript file. When I call this
> > > procedure
> > > from a worksheet module it executes perfectly. When I call it from a
> > > userform module, it crashes with the error "When you create a postscript
> > > file, you must rely on System fonts and use document fonts" and creates an
> > > empty postscript file. It should be calling the same print driver in both
> > > cases, but apparently is not. Does anyone know how to correct this? Am I
> > > missing a qualifier?
> > >
> > > Sub Printworkbookpdf()
> > >
> > > Dim myprinter As String
> > >
> > > myprinter=Application.ActivePrinter
> > > Worksheets("Cover").Select
> > > ActiveSheet.PrintOut Preview:=False, ActivePrinter:="Adobe PDF",
> > > PrintToFile:=True, PrToFileName:=psFileName
> > > Application.ActivePrinter=myprinter
> > >
> > > End Sub

> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
necessary to install printer driver for shared printer on computerthat is not attached to printer? aaronep@pacbell.net Printers 2 6th Sep 2011 03:20 PM
how to enable local printer AND disable network printer- printer w rni796 Windows XP Print / Fax 3 24th Nov 2008 05:46 PM
store default printer, change printer and then restore default printer? Dennis Pedersen Microsoft Excel Programming 0 14th Nov 2007 09:18 PM
Windows cannot connect to the printer. either the printer name was typed incorrectly, or the specified printer has lost its connection to the server. walter.seader@gmail.com Windows XP Networking 0 18th Oct 2006 09:37 PM
Error message: The server for the "fill in printer model here" printer does not have the correct printer driver installed. -- Read on... - errorP.JPG (0/1) Tom Barnett Microsoft Windows 2000 Printing 0 14th Oct 2003 08:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:02 AM.