Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing to File (PDF)
Hi All,
Here is the issue i'm facing, if anyone could help i would really appreciate. I have a file with number of ranges that i need to print. Macro activates those ranges and sends every single one to the printer. Now i want to instead of printing to printer, print to PDF file usind PDF995. Unfortunatelly, for every range printed it always promts me to name the pdf file. Is there a way to specify pdf file name in the code to avoid the prompt? Thanks Igor |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing to File (PDF)
Sourceforge has a more robust set of APIs to print PDFs. Check out this link...
http://www.excelguru.ca/node/21 NASA uses this one... -- HTH... Jim Thomlinson "igorek" wrote: Hi All, Here is the issue i'm facing, if anyone could help i would really appreciate. I have a file with number of ranges that i need to print. Macro activates those ranges and sends every single one to the printer. Now i want to instead of printing to printer, print to PDF file usind PDF995. Unfortunatelly, for every range printed it always promts me to name the pdf file. Is there a way to specify pdf file name in the code to avoid the prompt? Thanks Igor |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing to File (PDF)
Hi Jim,
Thanks for the post, however the code on this site is referring to VB code that is not available to me. All i have is crippled VBA under excel. And also, his code requires PDFCreator installed. I just bought Adobe Standard for $200 and do not want to spend another $300 for creator. Is there any other way you can suggest or know of? Thanks Igor "Jim Thomlinson" wrote: Sourceforge has a more robust set of APIs to print PDFs. Check out this link... http://www.excelguru.ca/node/21 NASA uses this one... -- HTH... Jim Thomlinson "igorek" wrote: Hi All, Here is the issue i'm facing, if anyone could help i would really appreciate. I have a file with number of ranges that i need to print. Macro activates those ranges and sends every single one to the printer. Now i want to instead of printing to printer, print to PDF file usind PDF995. Unfortunatelly, for every range printed it always promts me to name the pdf file. Is there a way to specify pdf file name in the code to avoid the prompt? Thanks Igor |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing to File (PDF)
Hi Igor,
I used this with Acrobat installed with success. With Acrobat you need to create a postscript file first and then convert it to a pdf. MyPath="c:\whatever you want" MyFile = igorsfilename 'Create postscript filename.(no file extension) PSFileName = myPath & MyFile & ".ps" 'Print page using distiller. MySheet.PrintOut , , 1, False, True, True, False, myPath & MyFile & ".ps" 'Define PDF filename myPDFFileName = myPath & MyFile & ".pdf" 'Define postscript log filename. Don't need this but distiller creates it anyway. myPDFLog = myPath & MyFile & ".log" 'Create a new distiller object. Set myPDF = New PdfDistiller 'Conver postscript file to PDF. myPDF.FileToPDF PSFileName, myPDFFileName, "" 'Delete the postscript & log files. Kill PSFileName Kill myPDFLog 'kill the Distiller object. Set myPDF = Nothing 'Go back and do next file. John "igorek" wrote in message ... Hi Jim, Thanks for the post, however the code on this site is referring to VB code that is not available to me. All i have is crippled VBA under excel. And also, his code requires PDFCreator installed. I just bought Adobe Standard for $200 and do not want to spend another $300 for creator. Is there any other way you can suggest or know of? Thanks Igor "Jim Thomlinson" wrote: Sourceforge has a more robust set of APIs to print PDFs. Check out this link... http://www.excelguru.ca/node/21 NASA uses this one... -- HTH... Jim Thomlinson "igorek" wrote: Hi All, Here is the issue i'm facing, if anyone could help i would really appreciate. I have a file with number of ranges that i need to print. Macro activates those ranges and sends every single one to the printer. Now i want to instead of printing to printer, print to PDF file usind PDF995. Unfortunatelly, for every range printed it always promts me to name the pdf file. Is there a way to specify pdf file name in the code to avoid the prompt? Thanks Igor |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing to File (PDF)
you are the best, thank you
"jaf" wrote: Hi Igor, I used this with Acrobat installed with success. With Acrobat you need to create a postscript file first and then convert it to a pdf. MyPath="c:\whatever you want" MyFile = igorsfilename 'Create postscript filename.(no file extension) PSFileName = myPath & MyFile & ".ps" 'Print page using distiller. MySheet.PrintOut , , 1, False, True, True, False, myPath & MyFile & ".ps" 'Define PDF filename myPDFFileName = myPath & MyFile & ".pdf" 'Define postscript log filename. Don't need this but distiller creates it anyway. myPDFLog = myPath & MyFile & ".log" 'Create a new distiller object. Set myPDF = New PdfDistiller 'Conver postscript file to PDF. myPDF.FileToPDF PSFileName, myPDFFileName, "" 'Delete the postscript & log files. Kill PSFileName Kill myPDFLog 'kill the Distiller object. Set myPDF = Nothing 'Go back and do next file. John "igorek" wrote in message ... Hi Jim, Thanks for the post, however the code on this site is referring to VB code that is not available to me. All i have is crippled VBA under excel. And also, his code requires PDFCreator installed. I just bought Adobe Standard for $200 and do not want to spend another $300 for creator. Is there any other way you can suggest or know of? Thanks Igor "Jim Thomlinson" wrote: Sourceforge has a more robust set of APIs to print PDFs. Check out this link... http://www.excelguru.ca/node/21 NASA uses this one... -- HTH... Jim Thomlinson "igorek" wrote: Hi All, Here is the issue i'm facing, if anyone could help i would really appreciate. I have a file with number of ranges that i need to print. Macro activates those ranges and sends every single one to the printer. Now i want to instead of printing to printer, print to PDF file usind PDF995. Unfortunatelly, for every range printed it always promts me to name the pdf file. Is there a way to specify pdf file name in the code to avoid the prompt? Thanks Igor |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing to File (PDF)
I have an issue similar to the original post and have tried implementing the
solution offered. However, I receive an error in the Dim myPDF As PdfDistiller step: User-defined type not defined. Outside the macro, I write from Excel to PDF all the time and I have Acrobat Distiller 8 installed. Any thoughts? Thanks. "igorek" wrote: you are the best, thank you "jaf" wrote: Hi Igor, I used this with Acrobat installed with success. With Acrobat you need to create a postscript file first and then convert it to a pdf. MyPath="c:\whatever you want" MyFile = igorsfilename 'Create postscript filename.(no file extension) PSFileName = myPath & MyFile & ".ps" 'Print page using distiller. MySheet.PrintOut , , 1, False, True, True, False, myPath & MyFile & ".ps" 'Define PDF filename myPDFFileName = myPath & MyFile & ".pdf" 'Define postscript log filename. Don't need this but distiller creates it anyway. myPDFLog = myPath & MyFile & ".log" 'Create a new distiller object. Set myPDF = New PdfDistiller 'Conver postscript file to PDF. myPDF.FileToPDF PSFileName, myPDFFileName, "" 'Delete the postscript & log files. Kill PSFileName Kill myPDFLog 'kill the Distiller object. Set myPDF = Nothing 'Go back and do next file. John "igorek" wrote in message ... Hi Jim, Thanks for the post, however the code on this site is referring to VB code that is not available to me. All i have is crippled VBA under excel. And also, his code requires PDFCreator installed. I just bought Adobe Standard for $200 and do not want to spend another $300 for creator. Is there any other way you can suggest or know of? Thanks Igor "Jim Thomlinson" wrote: Sourceforge has a more robust set of APIs to print PDFs. Check out this link... http://www.excelguru.ca/node/21 NASA uses this one... -- HTH... Jim Thomlinson "igorek" wrote: Hi All, Here is the issue i'm facing, if anyone could help i would really appreciate. I have a file with number of ranges that i need to print. Macro activates those ranges and sends every single one to the printer. Now i want to instead of printing to printer, print to PDF file usind PDF995. Unfortunatelly, for every range printed it always promts me to name the pdf file. Is there a way to specify pdf file name in the code to avoid the prompt? Thanks Igor |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing to File (PDF)
Noel got a response to his later post.
Noel wrote: I have an issue similar to the original post and have tried implementing the solution offered. However, I receive an error in the Dim myPDF As PdfDistiller step: User-defined type not defined. Outside the macro, I write from Excel to PDF all the time and I have Acrobat Distiller 8 installed. Any thoughts? Thanks. "igorek" wrote: you are the best, thank you "jaf" wrote: Hi Igor, I used this with Acrobat installed with success. With Acrobat you need to create a postscript file first and then convert it to a pdf. MyPath="c:\whatever you want" MyFile = igorsfilename 'Create postscript filename.(no file extension) PSFileName = myPath & MyFile & ".ps" 'Print page using distiller. MySheet.PrintOut , , 1, False, True, True, False, myPath & MyFile & ".ps" 'Define PDF filename myPDFFileName = myPath & MyFile & ".pdf" 'Define postscript log filename. Don't need this but distiller creates it anyway. myPDFLog = myPath & MyFile & ".log" 'Create a new distiller object. Set myPDF = New PdfDistiller 'Conver postscript file to PDF. myPDF.FileToPDF PSFileName, myPDFFileName, "" 'Delete the postscript & log files. Kill PSFileName Kill myPDFLog 'kill the Distiller object. Set myPDF = Nothing 'Go back and do next file. John "igorek" wrote in message ... Hi Jim, Thanks for the post, however the code on this site is referring to VB code that is not available to me. All i have is crippled VBA under excel. And also, his code requires PDFCreator installed. I just bought Adobe Standard for $200 and do not want to spend another $300 for creator. Is there any other way you can suggest or know of? Thanks Igor "Jim Thomlinson" wrote: Sourceforge has a more robust set of APIs to print PDFs. Check out this link... http://www.excelguru.ca/node/21 NASA uses this one... -- HTH... Jim Thomlinson "igorek" wrote: Hi All, Here is the issue i'm facing, if anyone could help i would really appreciate. I have a file with number of ranges that i need to print. Macro activates those ranges and sends every single one to the printer. Now i want to instead of printing to printer, print to PDF file usind PDF995. Unfortunatelly, for every range printed it always promts me to name the pdf file. Is there a way to specify pdf file name in the code to avoid the prompt? Thanks Igor -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Marco for printing to file/saving to file | Excel Programming | |||
printing to file | New Users to Excel | |||
printing to pdf file | Excel Worksheet Functions | |||
Error 1004 in printing .ps (postscript) file from .xls file | Excel Programming | |||
printing to a PDF file | Excel Programming |