Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
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
Marco for printing to file/saving to file [email protected] Excel Programming 0 July 31st 08 03:57 PM
printing to file Trevor New Users to Excel 2 August 23rd 06 10:01 AM
printing to pdf file dmexcel Excel Worksheet Functions 1 February 24th 06 03:43 AM
Error 1004 in printing .ps (postscript) file from .xls file chemburkar[_2_] Excel Programming 2 February 5th 04 11:33 PM
printing to a PDF file Tom S[_3_] Excel Programming 3 August 12th 03 09:34 PM


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