Is there something wrong with this code
Here what I'm trying to do is append multiple PDF documents into one main PDF document named oPDF2
But for each new page I have to merge his Data Layer and Overlay layer before adding it into my main document but It crash with automation error on the second .AppendEx oPDF3 why?!?
Set oPDF2 = CreateObject("PDFCreactiveX.PDFCreactiveX")
With oPDF2
.SetLicenseKey "Suite Evaluation Developer", "Mykey"
.ReportState = acReportStateDesign
.InitBlank
.Refresh
Set oPDF3 = CreateObject("PDFCreactiveX.PDFCreactiveX")
With oPDF3
.SetLicenseKey "Suite Evaluation Developer", "Mykey"
.ReportState = acReportStateDesign
.InitBlank
.Refresh
.Merge "D:\Program Files\AdpDS\Alliance\DALAYER01A1L.pdf", "", 2
.Merge "D:\Program Files\AdpDS\Alliance\OVERLAY01A1O.pdf", "", 2
End With
.MergeEx oPDF3, 1
Set oPDF3 = Nothing
Set oPDF3 = CreateObject("PDFCreactiveX.PDFCreactiveX")
With oPDF3
.SetLicenseKey "Suite Evaluation Developer", "Mykey"
.ReportState = acReportStateDesign
.InitBlank
.Refresh
.Merge "D:\Program Files\AdpDS\Alliance\DALAYER02A1L.pdf", "", 2
.Merge "D:\Program Files\AdpDS\Alliance\OVERLAY02A1O.pdf", "", 2
End With
.AppendEx oPDF3
Set oPDF3 = Nothing
Set oPDF3 = CreateObject("PDFCreactiveX.PDFCreactiveX")
With oPDF3
.SetLicenseKey "Suite Evaluation Developer", "Mykey"
.ReportState = acReportStateDesign
.InitBlank
.Refresh
.Merge "D:\Program Files\AdpDS\Alliance\DALAYER03A1O.pdf", "", 2
.Merge "D:\Program Files\AdpDS\Alliance\OVERLAY03A1L.pdf", "", 2
End With
.AppendEx oPDF3
Set oPDF3 = Nothing
Set oPDF3 = CreateObject("PDFCreactiveX.PDFCreactiveX")
With oPDF3
.SetLicenseKey "Suite Evaluation Developer", "Mykey"
.ReportState = acReportStateDesign
.InitBlank
.Refresh
.Merge "D:\Program Files\AdpDS\Alliance\DALAYER03A2O.pdf", "", 2
.Merge "D:\Program Files\AdpDS\Alliance\OVERLAY03A2L.pdf", "", 2
End With
.AppendEx oPDF3
Set oPDF3 = Nothing
.CurrentPage = 1
.StartSave "d:\testMergeDocsSI3.pdf", 1
For nPages = 1 To .PageCount
.SavePage nPages
Next
.EndSave
End With
Set oPDF2 = Nothing
Multiple AppendEx & Merge Crash with Automation Error
Hello,
There is nothing wrong in your code.
I tried a similar code myself that merges 3 documents and i didn't get any problem.
I suggest that your check which version of the PDF Creator you are using, if you are using an old version please feel free to downlaod our latest version 2.01 from our site.
If your are using the latest version i suggest that you try another file than the one that is failing, maybe this particular file can't be opened properly by the Creator, if this is the case you can send us your sample file to support@amyuni.com so our Engineers can check it and support it in the next release of the Creator.
There is nothing wrong in your code.
I tried a similar code myself that merges 3 documents and i didn't get any problem.
I suggest that your check which version of the PDF Creator you are using, if you are using an old version please feel free to downlaod our latest version 2.01 from our site.
If your are using the latest version i suggest that you try another file than the one that is failing, maybe this particular file can't be opened properly by the Creator, if this is the case you can send us your sample file to support@amyuni.com so our Engineers can check it and support it in the next release of the Creator.