How to Automate Adobe Acrobat Export to CSV Using VBA
Question details
The user needs a VBA script to automate the 'Export All' function in Adobe Acrobat Pro DC, extracting data from PDF response files into a CSV format while maintaining the correct tab order.

- Product
- Adobe Acrobat Pro DC / VBA
- Device & OS
- not provided
- Scenario
- Automating the extraction of PDF form responses and exporting the data sequentially to a CSV file for data analysis and reporting.
- Observed behavior
- Seeking a programmable method to bypass manual exporting, which requires calling Acrobat-specific APIs via VBA rather than using standard Excel VBA commands.
Ensure you have Adobe Acrobat Pro DC installed on your machine, as the free Acrobat Reader does not expose the necessary API objects for VBA automation. You must also enable the Adobe Acrobat Type Library within your VBA editor references before writing the script.
Utilize Acrobat API and JavaScript Object (JSO) in VBA
Standard VBA cannot directly manipulate PDF structures. You must use VBA to initialize the Acrobat application and bridge it to Acrobat's internal JavaScript API to execute the export commands.
Adobe Acrobat's OLE automation library is limited in its native VBA methods. To programmatically trigger the 'Export All' or 'Save As CSV' function, you need to instantiate the Acrobat application in VBA and call the `GetJSObject` method. This allows your VBA macro to run Acrobat-specific JavaScript commands that handle the CSV conversion.
Open the VBA Editor (Alt + F11), navigate to 'Tools' > 'References', and check the box for 'Adobe Acrobat XX.0 Type Library'.
Declare and set your Acrobat objects in the macro: `Set AcroApp = CreateObject("AcroExch.App")` and `Set AcroPDDoc = CreateObject("AcroExch.PDDoc")`.
Use the `AcroPDDoc.Open(filePath)` method to programmatically load the target PDF response file into the background.
Create the JavaScript bridge using `Set jso = AcroPDDoc.GetJSObject`. Then, use the `jso.saveAs(csvFilePath, "com.adobe.acrobat.csv")` method to export the form data in the correct tab order.

Easily Extract PDF Data to Spreadsheets with WPS Office
Instead of writing complex VBA bridges for the Adobe SDK, you can use WPS Office's powerful built-in PDF to Excel conversion tools to quickly extract PDF responses into structured spreadsheet formats.
- 1. Open PDF in WPS Office: Launch WPS Office and open the target PDF response file directly within the application.
- 2. Navigate to PDF Tools: Click on the 'Tools' tab in the top ribbon and select the 'PDF to Excel' option.
- 3. Configure Export Settings: Choose the specific pages you wish to export, ensure the layout settings match your data structure, and click 'Convert'.
- 4. Save as CSV: Once the file opens automatically in WPS Spreadsheet, go to 'Menu' > 'Save As' and select 'CSV (Comma delimited)' to finalize your export.

Frequently Asked Questions
Can I use standard Excel VBA to export PDF data without Acrobat Pro?
No, standard Excel VBA cannot natively read or export PDF internal structures. You require a premium PDF application that exposes an API, such as Adobe Acrobat Pro DC, or a dedicated third-party PDF parsing library.
Why do I need to use the Acrobat JavaScript object (JSO) in VBA?
The native Acrobat VBA API (OLE automation) is somewhat limited for file conversions. Advanced features, like exporting to specific formats with parameters (`doc.saveAs`), are exclusively exposed through Acrobat's JavaScript API, which can be invoked from VBA using the `GetJSObject` method.
How do I reference the Adobe Acrobat library in Excel VBA?
Open the VBA Editor by pressing Alt + F11, go to the 'Tools' menu, select 'References', and scroll down to check the box for 'Adobe Acrobat XX.0 Type Library'. This step is mandatory for your VBA code to recognize Acrobat objects.
Will exporting to CSV via VBA maintain the PDF form tab order?
Yes, when using Acrobat's `saveAs` method with the CSV conversion parameter, the API naturally exports form fields based on the internal tab order defined within the PDF's architecture.




