Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Addobe PDF printer


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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Addobe PDF printer


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" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Addobe PDF printer


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" wrote in message
...
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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Addobe PDF printer

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" wrote in message
...
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
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
Available Printer names to be placed in a range on a sheet and Force selection based on part of Printer name Corey Excel Programming 0 October 3rd 08 01:27 AM
store default printer, change printer and then restore default printer? Dennis Pedersen Excel Programming 0 November 14th 07 09:18 PM
members on my network printer not able to print to default printer smeheut Excel Discussion (Misc queries) 0 June 18th 07 06:42 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 05:38 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"