Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel vba print file to pdf (Problem)

Hi all:

I am very new to excel vba and am facing some challenges with the
attempt to write a vba code to print a financial report in pdf format.

I currently have an adobe reader 5.0 and Excel 2003.

I was trying to use ghostscript as suggested on the other postings, but
somehow, I cannot get the conversion part of it right

Here's my code.

Sub test()

Dim psfile As String

'Dim myPDF As PdfDistiller

'psfile = "C:\Documents and Settings\dpoon\Desktop\" & "123" & ".ps"


Application.ActivePrinter = "VBA2PDF on file:"

mypdf.filetoPDF "C:\Documents and Settings\dpoon\Desktop\" & "123" &
".ps", "C:\Documents and Settings\dpoon\Desktop\" & "123" & ".pdf"

MsgBox ActivePrinter

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=False,
Printtofile:=True, Collate:=True, PrToFileName:=psfile


End Sub



VBA2PDF on file is the "printer" I created using HP Deskjet1200 ps
driver. I could crate the .ps file alright, but how can I convert the
..ps file to .pdf without a acrobat distiller? Where can I find
pdfdistiller as an object, so that I could assign "mypdf" as a
pdfdistiller?

Your help is greatly appreciated.


Dennis poon

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel vba print file to pdf (Problem)


I realize it's impossible to make the conversion using merely an
Acrobat reader, you need adobe distiller in order for the VBA to assign
the file as "pdfdistiller" before any conversion is made possible.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel vba print file to pdf (Problem)


Hi there here's a good pdf to download
PDF Creator,
once you down load it and install it you will be able to select it as a
printer


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=518795

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel vba print file to pdf (Problem)

Thanks, dave

But which version would i have to donwload, and does the pdf
library/references would be added to the vba editor object reference
automatically? Or there are other setup procedures before hand?

Thanks.

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
print all worksheets of Excel file to one pdf file Centerfield Excel Discussion (Misc queries) 3 April 30th 09 04:51 AM
my excel is converting all my print jobs to print to file why? Ginger Excel Discussion (Misc queries) 2 April 10th 07 12:28 PM
How to make a routine that will automatically print a word file after it has been changed via an ole link to an excel file? Starriol Excel Programming 0 November 3rd 05 11:59 AM
Print-To-File Problem Gary's Student Excel Discussion (Misc queries) 4 September 4th 05 08:26 PM
FILE Save As / FILE Print greyed out in Excel Jeff Wright Excel Programming 2 September 3rd 03 09:29 AM


All times are GMT +1. The time now is 03:59 AM.

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"