LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default pdfDist.FileToPDF does nothing

Hello,

I'm trying to automate the creation of pdf files. I posted my code
below. The line I'm having problems with is

pdfDist.FileToPDF "c:\My Documents\testExcelToPDF.PS", "c:\My
Documents\testExcelToPDF.pdf", ""

The code runs without causing any errors, but the Adobe code doesn't
seem to work. I can see the .ps file being created, but when I step
through the FileToPDF line, nothing happens (no pdf is created, but no
error either). I'm using Excel 2003 with Acrobat 7.0 Professional and
Distiller 7.0. Thanks for your help.


Public Sub PostProblemOnNewsgroup()
Dim pdfDist As New ACRODISTXLib.PdfDistiller
Dim pdfPrinter, pdfName
Dim strFileName As String

Set fs = CreateObject("Scripting.FileSystemObject")

strFileName = "testExcelToPDF.ps"
Application.ActivePrinter = "Adobe PDF on Ne02:"

ActiveWindow.SelectedSheets.PrintOut Copies:=1, preview:=False, _
ActivePrinter:="Adobe PDF on Ne02:", printtofile:=True, _
collate:=True, PrToFileName:=strFileName

pdfDist.FileToPDF "c:\My Documents\testExcelToPDF.PS", "c:\My
Documents\testExcelToPDF.pdf", ""
Set pdfDist = Nothing
fs.DeleteFile pdfFilePath & "*.PS"
End Sub

 
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



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