Using VBA and Acrobat Add-in to export sheet as PDF

Basher515

New Member
Joined
Sep 16, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi there, been trying to research this but I guess I'm using the wrong search prompts, but I couldn't find a simple answer to what I want to do.

I want to use the Acrobat Add-in (PDFMOfficeAddin) that's installed on Excel to "Save As Adobe PDF" a specific worksheet called Charts.
Reason is, I've been using this method of printing the sheet as a PDF, and linking that PDF to an InDesign file.

However, this manual method was slow for me, so I used VBA and used the "regular" method using ExportAsFixedFormat and exported the Charts sheet that way.
What I did not realize however, is that it screwed up the links in InDesign, and the sizes are not being followed anymore. So instead of undoing that amount of work from InDesign, I just want to export once again through the Add-In.

Anyone know how to do so?

This is the original code that completely works, but just exports using the regular way. If someone can convert this and use the Acrobat Add-in instead, that'd be perfect.
VBA Code:
Public Sub Export_PDF()
    Dim Path As String
    Dim fn As String
    Dim ws As Worksheet
    Path = "G:\Proj\PDF\"
    fn = Left(ActiveWorkbook.name, InStr(1, ActiveWorkbook.name, ".") - 1)
    Set ws = Sheets("Charts")
    
    ws.PageSetup.FitToPagesWide = 1 
    
    'On Error Resume Next
    ws.ExportAsFixedFormat Type:=xlTypePDF, _
        Filename:=Path & fn & ".pdf"
End Sub
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Is there an API that you can add to Reference Library in the VBA Project for the PDFMOfficeAddin Add-In?
 
Upvote 0
Is there an API that you can add to Reference Library in the VBA Project for the PDFMOfficeAddin Add-In?
Yes, looking around other resources, the API can be called. However, those resources I've read talks about manipulating already existing PDFs and using Excel to do something about the contents of it. All I want is to present my sheet, call that API and print the sheet as PDF.

Sample: Create PDF bookmarks while combinding files with VBA in Excel
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,341
Members
452,638
Latest member
Oluwabukunmi

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