Error: ActiveX component can't create object 429 - trying to use Adobe for combine pdf

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875

Hi, 'm getting error in the U line.
what 'm trying to achieve here is to combine 2 pdf files into 1.
I have referenced to adobe acrobat 10.x type lib...
please help.

thanks.

Code:
Sub test5()[/FONT][FONT=courier new]'adobe Acrobat 10# type lib[/FONT]
[FONT=courier new]On Error GoTo errhnfler[/FONT]
[FONT=courier new]Dim AcroApp As Acrobat.CAcroApp[/FONT]
[FONT=courier new]    [/FONT]
[FONT=courier new]    Dim Part1Document As Acrobat.CAcroPDDoc[/FONT]
[FONT=courier new]    Dim Part2Document As Acrobat.CAcroPDDoc[/FONT]
[FONT=courier new]    [/FONT]
[FONT=courier new]    Dim numPages As Integer[/FONT]
[FONT=courier new]    [/FONT]
[U][FONT=courier new]    Set AcroApp = CreateObject("AcroExch.App")[/FONT][/U]
[FONT=courier new]    [/FONT]
[FONT=courier new]    Set Part1Document = CreateObject("AcroExch.PDDoc")[/FONT]
[FONT=courier new]    Set Part2Document = CreateObject("AcroExch.PDDoc")[/FONT]
[FONT=courier new]     [/FONT]
[FONT=courier new]    Part1Document.Open ("C:\rpt1CasesByWHContact.pdf")[/FONT]
[FONT=courier new]    Part2Document.Open ("C:\rpt2CasesByClientContact.pdf")[/FONT]
[FONT=courier new]    [/FONT]
[FONT=courier new]    ' Insert the pages of Part2 after the end of Part1[/FONT]
[FONT=courier new]    numPages = Part1Document.GetNumPages()[/FONT]
[FONT=courier new]    [/FONT]
[FONT=courier new]    If Part1Document.InsertPages(numPages - 1, Part2Document, 0, Part2Document.GetNumPages(), True) = False Then[/FONT]
[FONT=courier new]        MsgBox "Cannot insert pages"[/FONT]
[FONT=courier new]    End If[/FONT]
[FONT=courier new]     [/FONT]
[FONT=courier new]    If Part1Document.Save(PDSaveFull, "C:\MergedFile.pdf") = False Then[/FONT]
[FONT=courier new]        MsgBox "Cannot save the modified document"[/FONT]
[FONT=courier new]    End If[/FONT]
[FONT=courier new]        [/FONT]
[FONT=courier new]    Part1Document.Close[/FONT]
[FONT=courier new]    Part2Document.Close[/FONT]
[FONT=courier new]     [/FONT]
[FONT=courier new]    AcroApp.Exit[/FONT]
[FONT=courier new]    Set AcroApp = Nothing[/FONT]
[FONT=courier new]    Set Part1Document = Nothing[/FONT]
[FONT=courier new]    Set Part2Document = Nothing[/FONT]
[FONT=courier new]     [/FONT]
[FONT=courier new]    MsgBox "Done"[/FONT]
[FONT=courier new]    [/FONT]
[FONT=courier new]    End[/FONT]
[FONT=courier new]errhnfler:[/FONT]
[FONT=courier new]    Debug.Print Err.Description & " " & Err.Number[/FONT]
[FONT=courier new]End Sub[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
If you have a reference to Adobe you don't need to use CreateObject.

You can use something like this.
Code:
Set AcroApp = New AcroExch.App
 
Last edited:
Upvote 0
i wish it worked but still another error....
Compile error - User defined type not defined
 
Upvote 0
Do you have the correct reference for AcroExch.AcroApp?
 
Upvote 0
Is that the correct reference?

Do you have the appropriate application(s) installed?
 
Upvote 0
i have the Adobe Reader 10.0 Installed in my system.
i googled and the reference is correct.
 
Upvote 0
I think you need more than Adobe Reader.
 
Upvote 0
Norie, you're right...I tried in office system and worked.
and not in my laptop :) so i need something more than that....
 
Upvote 0
What is it that's installed in the office?
 
Upvote 0

Forum statistics

Threads
1,223,635
Messages
6,173,479
Members
452,516
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top