Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

424
Vistas
jso.numfields not returning anything within Excel VBA while connecting to PDF file

So I am trying to write a VBA Macro in Excel that will loop through all 400+ .pdf files I have in a folder, extract pertinent data from them, and store that data in an Excel spreadsheet. However I am not sure that my .pdf files are even being opened. My file path is good, but when I try to detect any fields in the .pdf file using .numfields, it returns 0. I've checked Adobe Acrobat in my References tool, are there any 'things' I need to set up for JS Objects to work in Excel VBA ?

Here is my code so far:

Private Sub CoH_Water_Invoice()

     'Declare the File Path
     Dim path As String: path = "K:\Administration\Utilities\FY22\"
     Dim file As String: file = Dir(path & "*.pdf")

     'Set up Variables/Acrobat Objects
     Dim AcroApp As Acrobat.CAcroApp
     Dim theForm As Acrobat.CAcroPDDoc
     Dim jso As Object

     Set AcroApp = CreateObject("AcroExch.App")
     Set theForm = CreateObject("AcroExch.PDDoc")
     theForm.Open(path & file)
     Set jso = theForm.GetJSObject

     'Check for fields
     If jso.numfields > 0 Then
          Debug.Print("Fields detected")
     Else
          Debug.Print("No Fields detected")
     End If

     theForm.Close
     AcroApp.Exit
     Set AcroApp = Nothing
     Set theForm = Nothing
End Sub

In the "Immediates" window, I always get "No Fields detected", so it is not picking up any fields in the JS Object. Any ideas?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda