+ Reply to Thread
Results 1 to 2 of 2

pdfDist.FileToPDF does nothing

  1. #1
    barbetta3141@yahoo.com
    Guest

    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


  2. #2
    SA
    Guest

    Re: pdfDist.FileToPDF does nothing

    Running the distiller com object does require administrator privileges on
    your machine. That may be an issue.

    If you want a relatively easy way to output a worksheet or whole workbook to
    a PDF file using VBA and Acrobat 7, you might want to look at our XL PDF
    Wizard Add In. You can not only automate creation of XL based PDFs but also
    merge in Word docs and external PDF files and bookmark the whole thing using
    code. You'll find it in the developer tools section of our web.

    Hope this helps
    --
    SA
    ACG Soft
    http://ourworld.compuserve.com/homepages/attac-cg

    <barbetta3141@yahoo.com> wrote in message
    news:1148305959.314038.318910@u72g2000cwu.googlegroups.com...
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1