6 Replies Latest reply on May 19, 2009 8:11 AM by gerger54

    VBAsript to make pdf-files from excel

    gerger54

      I tried the script from the topic

      http://forums.adobe.com/message/1101063#1101063

      and adjusted a little bit to

       

      Sub adobeExample()
      Dim Xlapp 'Excel
      Dim wb 'le classeur
      Set Xlapp = CreateObject("Excel.application")
      Xlapp.Visible = False
      Set wb = Xlapp.Workbooks.Open("h:\test pdf.xls")
      wb.Sheets(1).PrintOut , , , , "Adobe PDF", True, , "c:\MJB\essai.ps"
      wb.Close False
      Dim dis 'distiller app
      Dim ps 'le fichier ps
      Set dis = CreateObject("PdfDistiller.PdfDistiller")
      dis.FileToPDF "c:\MJB\essai.ps", "c:\MJB\essai.pdf", ""
      Xlapp.Quit
      Set wb = Nothing
      Set Xlapp = Nothing

      End Sub

       

      The sript stops at the red line saying " ActiveX component can't create object"

       

      I work with Excel2003SP3, with adobe pdf maker 6.0(this addin works fine)

      and my printers installed are AcrobatPDF and Acrobat Distiller.

      Acrobat reader 8.0 and Acrobat 6.0 Professional installed as well

       

      Any suggestions?

       

      Thanks in advance

      Ger