How to Fix VBA Error Object Doesn't Support Property rawValue in PDF XFA Forms
Question details
The user needs to resolve a VBA runtime error that occurs when trying to access or set the rawValue property of an empty form field in an XFA PDF form.

- Product
- Adobe PDF XFA Forms
- Device & OS
- not provided
- Scenario
- Automating XFA PDF forms using Access VBA and interacting with unpopulated or blank form fields.
- Observed behavior
- The system throws a runtime error stating "Object doesn't support this property or method" when querying the rawValue property.
Ensure you have the correct Adobe Acrobat Developer libraries referenced in your Access VBA project before attempting to manipulate XML nodes and XFA form objects.
Pre-initialize Form Fields Before VBA Automation
The easiest way to prevent the rawValue error is to ensure the fields contain dummy values or spaces so their underlying XML nodes are fully initialized.
Because unpopulated fields in XFA forms may not fully initialize their XML nodes, Access VBA cannot read a `rawValue` that hasn't been created yet. Assigning a default value forces the node generation.
Open your XFA PDF form in Adobe LiveCycle Designer or your primary PDF editor.
Select the blank form fields that you plan to target and automate using your VBA script.
Enter a default space character (" ") or a dummy value (like "0") into the properties or default value section of these fields.
Save the PDF form and re-run your Access VBA script. The `rawValue` property should now be accessible without throwing an error.

Use Acrobat JSObject and XFA Scripting Model in VBA
You can bypass the error by modifying your VBA code to reference the XML DOM through the Acrobat JSObject interface, resolving nodes directly.
Try WPS Office for Seamless PDF and Document Management
Struggling with complex VBA scripts, heavy enterprise software, and XFA form compatibility? Switch to WPS Office. It provides a lightweight, comprehensive suite for Word, Excel, PowerPoint, and standard PDF editing, offering a highly user-friendly alternative.
- 1. Visit the Website: Go to the official WPS Office website to access the download page.
- 2. Download the Installer: Click the 'Free Download' button to get the setup file tailored for your system.
- 3. Install the Software: Run the installer and follow the simple on-screen instructions to complete the setup.
- 4. Manage PDFs the Easy Way: Open WPS Office and utilize its built-in PDF tools for a significantly smoother document handling experience.

Frequently Asked Questions
Why does the 'Object doesn't support this property' error only happen on blank XFA fields?
In Adobe XFA (XML Forms Architecture), an empty field might not have its corresponding XML data node instantiated in the background file structure yet. Without the node existing, VBA cannot locate or interact with the `rawValue` property, resulting in a runtime error.
Can I use standard AcroForm techniques to fill XFA forms via VBA?
No, XFA forms use a fundamentally different underlying architecture (XML-based) than standard PDF AcroForms. Standard PDF library methods for retrieving and filling form fields usually will not work on XFA documents, requiring you to shift to the JSObject interface and XFA scripting models.
Is there a way to check if an XFA field is empty before calling rawValue in VBA?
Yes, you can use the `xfa.resolveNode` method inside your VBA (via the JSObject) to check if a specific form node returns Null or is undefined. Wrapping your node manipulation in an IF condition prevents attempting to read or write to a non-existent `rawValue` property.
Will converting my XFA form to a standard PDF fix the VBA automation issues?
Yes. If your form relies solely on static fields and doesn't require dynamic XFA features (like expanding rows or flowing text), flattening or converting the XFA form to a standard AcroForm makes it significantly easier to automate using conventional VBA PDF object libraries.




