Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Creating PDF from Excel Using PrintToFile

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Creating PDF from Excel Using PrintToFile

You can install a PDF printer driver such as PDF995
make the PDF driver driver the default printer in Windows


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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Creating PDF from Excel Using PrintToFile

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" wrote:

You can install a PDF printer driver such as PDF995
make the PDF driver driver the default printer in Windows


"Carmen" wrote in message
...
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
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
PrintToFile - PDF Issue Wayne Huxman Excel Programming 0 July 8th 06 02:44 PM
PrintToFile from spreadsheet juzek Excel Programming 0 June 28th 06 10:39 PM
PrintToFile OutputFilename problems Brent Burkart Excel Programming 4 June 14th 04 05:30 PM
PrintToFile param - what's the file format? jstrater Excel Programming 3 May 16th 04 10:09 PM


All times are GMT +1. The time now is 11:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"