+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24

Thread: Printing PDF Excel 2003 Macro

  1. #16
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: Printing PDF Excel 2003 Macro

    The only one I need with Acrobat 6.0 is the Acrobat Distiller reference.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  2. #17
    Registered User
    Join Date
    07-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Printing PDF Excel 2003 Macro

    The problem I think is with this piece of code:

     mypdfDist.FileToPDF tempPSFileName, tempPDFFileName, ""
    Also - it is still printing on my default printer and not the pdf..... any ideas?

  3. #18
    Registered User
    Join Date
    07-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Printing PDF Excel 2003 Macro

    Any ides on the code:

     Sub Create_PDF(wsPrint_Sheet As Worksheet)
    
    'Dom Hill, June 2008
    'This code has only been tested with Adobe Acrobat 6.0 Professional
    'For this code to work the Adobe Distiller VBA library must be enabled
    'Select Tools...References in the VBA editor and check it from the list
    
    Dim tempPDFFileName As String
    Dim tempPSFileName As String
    Dim tempPDFRawFileName As String
    Dim tempLogFileName As String
    
    tempPDFRawFileName = "C:\" & wsPrint_Sheet.Name
    
    tempPSFileName = tempPDFRawFileName & ".ps"
    tempPDFFileName = tempPDFRawFileName & ".pdf"
    tempLogFileName = tempPDFRawFileName & ".log"
    
    'Prints worksheet as a pdf
    
        wsPrint_Sheet.PrintOut Copies:=1, preview:=False, ActivePrinter:= _
    "Acrobat Distiller on Ne03:", printtofile:=True, Collate:=True, prtofilename:=tempPSFileName
    
    Dim mypdfDist As New PdfDistiller
    
    mypdfDist.FileToPDF tempPSFileName, tempPDFFileName, ""
    
    Kill tempPSFileName
    Kill tempLogFileName
    
    End Sub
    I think I might be getting something mixed up here:

        wsPrint_Sheet.PrintOut Copies:=1, preview:=False, ActivePrinter:= _
    "Acrobat Distiller on Ne03:", printtofile:=True, Collate:=True, prtofilename:=tempPSFileName

  4. #19
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: Printing PDF Excel 2003 Macro

    Looks fine but I've still no idea if it will work in Adobe 5.0. I'm guessing not from the problems you're having.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  5. #20
    Registered User
    Join Date
    07-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Printing PDF Excel 2003 Macro

    OK - how about PDF Creator. Do you know if this would work for that? what changes would I need here... thanks

  6. #21
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: Printing PDF Excel 2003 Macro

    Never had cause to use it myself but all the info is there on the link that Roy posted.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  7. #22
    Registered User
    Join Date
    07-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Printing PDF Excel 2003 Macro

    I have just run it again and this time i get the following error:
    Run-time error 429
    ActiveX component can’t create object

    any ideas?

  8. #23
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: Printing PDF Excel 2003 Macro

    Quote Originally Posted by omarq View Post
    Thanks,

    I ran the macro and it printed the first sheet via the printer, it goes on:

    I'm geting a "Run-time error '429"

    ActiveX component can't create object.

    When I go to visual basic it references:
    mypdfDist.FileToPDF tempPSFileName, tempPDFFileName, ""
    How is that different from the above error you were getting the other day?

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  9. #24
    Registered User
    Join Date
    07-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Printing PDF Excel 2003 Macro

    ahhh -sorry. i've been looking at this for so long i'm getting fish for brains. apologies

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0