Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Available Printer names to be placed in a range on a sheet and Force selection based on part of Printer name | Excel Programming | |||
store default printer, change printer and then restore default printer? | Excel Programming | |||
members on my network printer not able to print to default printer | Excel Discussion (Misc queries) | |||
Printer Multiple Worksheets with a particular Printer Setting | Excel Worksheet Functions | |||
Send printer escape commands to a printer using VBA | Excel Programming |