PC Review


Reply
Thread Tools Rate Thread

Creating PDF from Excel Using PrintToFile

 
 
Carmen
Guest
Posts: n/a
 
      27th Dec 2007
Hello,

I've looked through the web to learn that if I want to convert Excel to PDF
and give it a specific name (automatically) through macro I should use

....printout PrintToFile:=True, PRtoFileName:="I/....xx.pdf"

But there's an error accessing the created pdf. It's all due to PrintToFile
functionality. If I change destination file name extension to .prn, then it
works.

However, when I double click on this .prn file it asks me to choose a
program. It then converts it to adobe acrobat file.

It's there a more direct way to create from excel to pdf and having file
name as variable? My intention is to create batches of pdfs from excel and
through macro emailing out to people. I want to skip the step of converting
from .prn to .pdf (haven't figured how I would do it).

Thanks,
Carmen


 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      27th Dec 2007
Microsoft does not support the PDF conversion. However, they recommend a
service to do it. There are several with free downloadable converters.
Google the web for Excel to PDF converter.

"Carmen" wrote:

> Hello,
>
> I've looked through the web to learn that if I want to convert Excel to PDF
> and give it a specific name (automatically) through macro I should use
>
> ...printout PrintToFile:=True, PRtoFileName:="I/....xx.pdf"
>
> But there's an error accessing the created pdf. It's all due to PrintToFile
> functionality. If I change destination file name extension to .prn, then it
> works.
>
> However, when I double click on this .prn file it asks me to choose a
> program. It then converts it to adobe acrobat file.
>
> It's there a more direct way to create from excel to pdf and having file
> name as variable? My intention is to create batches of pdfs from excel and
> through macro emailing out to people. I want to skip the step of converting
> from .prn to .pdf (haven't figured how I would do it).
>
> Thanks,
> Carmen
>
>

 
Reply With Quote
 
MC
Guest
Posts: n/a
 
      28th Dec 2007
It can be done e.g. with Bullzip PDF printer - www.bullzip.com.
I built PDF's save option in the one of my projects using Ghostscript as
well, but it requires a much more code to generate a postscript file
first and convert it to pdf (I guess you would like to use the Bullzip
choice). There is available some documentation with Bullzip here
http://www.bullzip.com/products/pdf2...o.php#Settings.
It seems your task can be simply done via Bullzip settings.ini file
modifying.

HTH
Mariusz


JLGWhiz pisze:
> Microsoft does not support the PDF conversion. However, they recommend a
> service to do it. There are several with free downloadable converters.
> Google the web for Excel to PDF converter.
>
> "Carmen" wrote:
>
>> Hello,
>>
>> I've looked through the web to learn that if I want to convert Excel to PDF
>> and give it a specific name (automatically) through macro I should use
>>
>> ...printout PrintToFile:=True, PRtoFileName:="I/....xx.pdf"
>>
>> But there's an error accessing the created pdf. It's all due to PrintToFile
>> functionality. If I change destination file name extension to .prn, then it
>> works.
>>
>> However, when I double click on this .prn file it asks me to choose a
>> program. It then converts it to adobe acrobat file.
>>
>> It's there a more direct way to create from excel to pdf and having file
>> name as variable? My intention is to create batches of pdfs from excel and
>> through macro emailing out to people. I want to skip the step of converting
>> from .prn to .pdf (haven't figured how I would do it).
>>
>> Thanks,
>> Carmen
>>
>>

>



 
Reply With Quote
 
Carmen
Guest
Posts: n/a
 
      28th Dec 2007
Due to office policy and the fact that this will have to be shared with other
units. I'm unable to install Ghostscript. This means that I might have to
take the long way. Is there a suggestion as to where I can find some help
on this?

Thanks very much,
Carmen

"MC" wrote:

> It can be done e.g. with Bullzip PDF printer - www.bullzip.com.
> I built PDF's save option in the one of my projects using Ghostscript as
> well, but it requires a much more code to generate a postscript file
> first and convert it to pdf (I guess you would like to use the Bullzip
> choice). There is available some documentation with Bullzip here
> http://www.bullzip.com/products/pdf2...o.php#Settings.
> It seems your task can be simply done via Bullzip settings.ini file
> modifying.
>
> HTH
> Mariusz
>
>
> JLGWhiz pisze:
> > Microsoft does not support the PDF conversion. However, they recommend a
> > service to do it. There are several with free downloadable converters.
> > Google the web for Excel to PDF converter.
> >
> > "Carmen" wrote:
> >
> >> Hello,
> >>
> >> I've looked through the web to learn that if I want to convert Excel to PDF
> >> and give it a specific name (automatically) through macro I should use
> >>
> >> ...printout PrintToFile:=True, PRtoFileName:="I/....xx.pdf"
> >>
> >> But there's an error accessing the created pdf. It's all due to PrintToFile
> >> functionality. If I change destination file name extension to .prn, then it
> >> works.
> >>
> >> However, when I double click on this .prn file it asks me to choose a
> >> program. It then converts it to adobe acrobat file.
> >>
> >> It's there a more direct way to create from excel to pdf and having file
> >> name as variable? My intention is to create batches of pdfs from excel and
> >> through macro emailing out to people. I want to skip the step of converting
> >> from .prn to .pdf (haven't figured how I would do it).
> >>
> >> Thanks,
> >> Carmen
> >>
> >>

> >

>
>
>

 
Reply With Quote
 
Karl
Guest
Posts: n/a
 
      28th Dec 2007
You can install a PDF printer driver such as PDF995
make the PDF driver driver the default printer in Windows


"Carmen" <(E-Mail Removed)> wrote in message
news:E5D5810D-017A-415F-917E-(E-Mail Removed)...
> Hello,
>
> I've looked through the web to learn that if I want to convert Excel to
> PDF
> and give it a specific name (automatically) through macro I should use
>
> ...printout PrintToFile:=True, PRtoFileName:="I/....xx.pdf"
>
> But there's an error accessing the created pdf. It's all due to
> PrintToFile
> functionality. If I change destination file name extension to .prn, then
> it
> works.
>
> However, when I double click on this .prn file it asks me to choose a
> program. It then converts it to adobe acrobat file.
>
> It's there a more direct way to create from excel to pdf and having file
> name as variable? My intention is to create batches of pdfs from excel
> and
> through macro emailing out to people. I want to skip the step of
> converting
> from .prn to .pdf (haven't figured how I would do it).
>
> Thanks,
> Carmen
>
>



 
Reply With Quote
 
Dana DeLouis
Guest
Posts: n/a
 
      29th Dec 2007
> Microsoft does not support the PDF conversion.

Just to add...Office 2007 has a PDF converter:

2007 Microsoft Office Add-in: Microsoft Save as PDF

If the link is bad, it listed under Office Downloads at Microsoft

http://www.microsoft.com/downloads/d...displaylang=en

--
Dana DeLouis


"JLGWhiz" <(E-Mail Removed)> wrote in message
news:2D6C4C60-E80C-4D45-AFE8-(E-Mail Removed)...
> Microsoft does not support the PDF conversion. However, they recommend a
> service to do it. There are several with free downloadable converters.
> Google the web for Excel to PDF converter.
>
> "Carmen" wrote:
>
>> Hello,
>>
>> I've looked through the web to learn that if I want to convert Excel to
>> PDF
>> and give it a specific name (automatically) through macro I should use
>>
>> ...printout PrintToFile:=True, PRtoFileName:="I/....xx.pdf"
>>
>> But there's an error accessing the created pdf. It's all due to
>> PrintToFile
>> functionality. If I change destination file name extension to .prn, then
>> it
>> works.
>>
>> However, when I double click on this .prn file it asks me to choose a
>> program. It then converts it to adobe acrobat file.
>>
>> It's there a more direct way to create from excel to pdf and having file
>> name as variable? My intention is to create batches of pdfs from excel
>> and
>> through macro emailing out to people. I want to skip the step of
>> converting
>> from .prn to .pdf (haven't figured how I would do it).
>>
>> Thanks,
>> Carmen
>>
>>



 
Reply With Quote
 
Tony Gravagno
Guest
Posts: n/a
 
      30th Dec 2007
The free PDFCreator is another similar, and IMO better option. The
following macro shows how to change the printer and print the document
at runtime. Source:
<http://www.exceltip.com/st/Change_the_default_printer_using_VBA_in_Microsoft_Excel/453.html>

You'll need to keep the name of the PDF printer consistent on all
workstations, or store the name of the PDF printer somewhere and read
it at runtime. This macro has it hardcoded to a specific fax device.

Sub PrintToAnotherPrinter()
Dim STDprinter As String
STDprinter = Application.ActivePrinter
Application.ActivePrinter = "microsoft fax on fax:"
' change printer
ActiveSheet.PrintOut
' prints the active sheet
Application.ActivePrinter = STDprinter
' change back to standard printer
End Sub

You may not like the idea of installing something like PDFCreator on
your systems, but you don't have much of a choice honestly - the PC
needs to have a driver and need to be made aware of the printer.

HTH



"Karl" <(E-Mail Removed)> wrote:

>You can install a PDF printer driver such as PDF995
>make the PDF driver driver the default printer in Windows
>
>
>"Carmen" <(E-Mail Removed)> wrote in message
>news:E5D5810D-017A-415F-917E-(E-Mail Removed)...
>> Hello,
>>
>> I've looked through the web to learn that if I want to convert Excel to
>> PDF
>> and give it a specific name (automatically) through macro I should use
>>
>> ...printout PrintToFile:=True, PRtoFileName:="I/....xx.pdf"
>>
>> But there's an error accessing the created pdf. It's all due to
>> PrintToFile
>> functionality. If I change destination file name extension to .prn, then
>> it
>> works.
>>
>> However, when I double click on this .prn file it asks me to choose a
>> program. It then converts it to adobe acrobat file.
>>
>> It's there a more direct way to create from excel to pdf and having file
>> name as variable? My intention is to create batches of pdfs from excel
>> and
>> through macro emailing out to people. I want to skip the step of
>> converting
>> from .prn to .pdf (haven't figured how I would do it).
>>
>> Thanks,
>> Carmen
>>
>>

>


 
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
PrintToFile - PDF Issue Wayne Huxman Microsoft Excel Programming 0 8th Jul 2006 02:44 PM
PrintToFile from spreadsheet juzek Microsoft Excel Programming 0 28th Jun 2006 10:39 PM
PrintToFile OutputFilename problems Brent Burkart Microsoft Excel Programming 4 14th Jun 2004 05:30 PM
PrintToFile param - what's the file format? =?Utf-8?B?anN0cmF0ZXI=?= Microsoft Excel Programming 3 16th May 2004 10:09 PM
PrintToFile and Forcing Save-As Dialog Box? Matthew Workman Microsoft C# .NET 0 17th Dec 2003 08:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:24 AM.