+ Reply to Thread
Results 1 to 5 of 5

Run-time error 429

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-05-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    149

    Run-time error 429

    Hi,

    I have this code in outlook 365 to export to PDF attachments every time run it get run-time error 429 Activex component can't create object

    and highlight this line:

    Set DestinationPdf = CreateObject("AcroExch.PDDoc")

    here is the complete code:

    ' Merge multiple PDF documents into a single PDF.
    Private Sub MergePdfDocuments(PdfPath)
      'Set AcrobatApp = CreateObject("AcroExch.App")
    
      Set DestinationPdf = CreateObject("AcroExch.PDDoc")
      Set SourcePdf = CreateObject("AcroExch.PDDoc")
    
      ' Initialise the progress bar component.
      ' This resets the progress bar after converting documents to PDF.
      ProgressForm.Increment 0, "Merging..."
      Counter = 0
    
      ' We will merge PDFs into the first PDF.
      DestinationPdfPath = FilesToMerge.Item(1)
      DestinationPdf.Open DestinationPdfPath
      FilesToMerge.Remove (1)
    
      ' Iterate through the emails and attachments that were saved to the file system.
      For Each FileToMerge In FilesToMerge
        ProgressForm.Increment (Counter / FilesToMerge.count) * 100, "Merging..."
        Sleep 250
    
        ' Open the source PDF.
        SourcePdf.Open FileToMerge
    
        ' The page number within the destination PDF where content will be inserted.
        LastPage = DestinationPdf.GetNumPages - 1
    
        ' The number of pages to insert.
        NumberOfPagesToInsert = SourcePdf.GetNumPages
    
        ' Insert the content into the destination PDF.
        DestinationPdf.InsertPages LastPage, SourcePdf, 0, NumberOfPagesToInsert, False
    
        ' Close and then delete the source PDF.
        SourcePdf.Close
        Kill FileToMerge
    
        Counter = Counter + 1
      Next FileToMerge
    
      ' Save the merged PDF and delete the original.
      DestinationPdf.Save 1, PdfPath
      Kill DestinationPdfPath
    
      ' Close the PDF document.
      DestinationPdf.Close
    End Sub
    thank you

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,747

    Re: Run-time error 429

    First, has this code ever worked? Second, do you have Adobe Acrobat (not Acrobat Reader) installed on your machine?
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    11-05-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Run-time error 429

    no first time I run it and I don't have acrobat does that means cannot use this code?



    thank you

  4. #4
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Run-time error 429

    the calls made to adobe acrobat, means that you need to have it on your machine to run this code..
    If you have office 365, you can just do a save as PDF and use the built in pdf feature in office?
    If you find the suggestion or solution helpful, please consider adding reputation to the post.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,747

    Re: Run-time error 429

    You must have Acrobat for this code to work. You are not exporting Excel data to PDFs, you are merging existing PDF files. This is not an Excel task; you just happen to be using VBA to do it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Error message: Run-Time error '1004 '; application-defined or object-defined error
    By Davasu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2015, 06:52 AM
  2. Replies: 1
    Last Post: 10-22-2015, 05:50 AM
  3. VBA ERROR: run time error 1004: Application-defined or Object-defined error in excel 2013
    By AnanthKrishna in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2015, 06:16 AM
  4. Cannot Publish Excel Pivot Chart - Run Time Error
    By crisb184 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2013, 07:04 AM
  5. [SOLVED] Error " Run-time error '1004': application defined or object defined error
    By lengwer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2013, 07:26 AM
  6. run-time error ;2147023179 (800706b5) time automation error interface unknown
    By karthik72 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-02-2012, 09:31 AM
  7. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM

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