Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

425
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda