Using VBA, how do I call the Adobe Create PDF function

Sheets("Key Indicators").ExportAsFixedFormat Type:=xlTypePDF, Filename:=ArchivePath, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _ :=False, OpenAfterPublish:=False 

This is currently what I have.

I understand how ExportAsFixedFormat PDF, but I need to know how to do this, is to access the Create PDF function under Acrobat (as shown in the figure below) using VBA. If I do ExportAsFixedFormat, the links are aligned. Acrobat "Create PDF" will allow me to convert Excel to PDF with hyperlinks enabled.

AdobePDFMakerForOffice

How can I do it?

I am using Excel 2016 and Adobe Pro DC

enter image description here These are my adobe recommendations.

+5
source share
4 answers

Acrobat link should work Here is a guide from Adobe
After adding, you can use the following code tip. This may lead to coding correction. I'm not quite sure, since I coded it blindly because I don't have Acrobat on my PC. Debug step by step to find out what to do.

 Sub ExportWithAcrobat() Dim AcroApp As Acrobat.CAcroApp 'I'm not quite sure it needed since we are creating the doc directly Dim AcrobatDoc As Acrobat.CAcroPDDoc Dim numPages As Long Dim WorkSheetToPDF As Worksheet Const SaveFilePath = "C:\temp\MergedFile.pdf" Set AcroApp = CreateObject("AcroExch.App") 'I'm not quite sure it needed since we are creating the doc directly Set AcrobatDoc = CreateObject("AcroExch.PDDoc") 'it going to be 0 at first since we just created numPages = AcrobatDoc.GetNumPages For Each WorkSheetToPDF In ActiveWorkbook.Worksheets If AcrobatDoc.InsertPages(numPages - 1, WorkSheetToPDF, 0, AcrobatDoc.GetNumPages(), True) = False Then 'you should be available to work with the code to see how to insert the sheets that you want in the created object ' 1. If Part1Document.InsertPages(numPages - 1, "ExcelSheet?", 0, AcrobatDoc.GetNumPages(), True) = False MsgBox "Cannot insert pages" & numPages Else ' 1. If Part1Document.InsertPages(numPages - 1, "ExcelSheet?", 0, AcrobatDoc.GetNumPages(), True) = False numPages = numPages + 1 End If ' 1. If Part1Document.InsertPages(numPages - 1, "ExcelSheet?", 0, AcrobatDoc.GetNumPages(), True) = False Next WorkSheetToPDF If AcrobatDoc.Save(PDSaveFull, SaveFilePath) = False Then ' 2. If Part1Document.Save(PDSaveFull, "C:\temp\MergedFile.pdf") = False MsgBox "Cannot save the modified document" End If ' 2. If Part1Document.Save(PDSaveFull, "C:\temp\MergedFile.pdf") = False End Sub 

The following pages may provide better help: Link1 , Link2

+1
source
 Sub PDF() ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "C:\Users\PCNAME\Documents\Book1.pdf", Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ True End Sub 

Please try the codes above.

+2
source
 With ActiveSheet .ExportAsFixedFormat Type:=xlTypePDF, Filename:="N:\JKDJKDJ", _ Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False End With 
+1
source

You can publish any Excel range as a PDF using ExportAsFixedFormat. No need to link to Acrobat.

 ' Usage: ' PublishRangePDF(Thisworkbook, fileName) : Will Publish the entire Workbook ' PublishRangePDF(AvtiveSheet, fileName) : Will Publish all selected worksheets ' PublishRangePDF(Range("A1:H100"), fileName) : Will Publish Range("A1:H100") Sub PublishRangePDF(RangeObject As Object, fileName As String, Optional OpenAfterPublish As Boolean = False) On Error Resume Next RangeObject.ExportAsFixedFormat Type:=xlTypePDF, fileName:=fileName, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=OpenAfterPublish On Error GoTo 0 End Sub 
+1
source

All Articles