• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Import excel data to existing pdf form

New Here ,
Nov 22, 2020 Nov 22, 2020

Copy link to clipboard

Copied

I am trying to autofill an existing PDF from excel table. Overall i have figured out the vba design however currently stuck at how to populate date fields where it only accepts data as Y Y Y Y M M D D meaning each digit is individually typed. In excel i have the date as 20201225 however the vba is unable to copy paste that into the date field.

 

How can i parse the date field in excel to allow the form to be populated? 

 

For example i want date value from Col A to first date field in the form and Value from Col B to Second date field.

Capturee.PNG

Capturre.PNG

The macro is unable to copy paste data for this field:

 

Application.SendKeys "{Tab}", True
Application.SendKeys datenominee, True
Application.Wait Now + 0.000005
Sub createpdfforms()
Dim pdftemplatefile, newpdfname, savepdffolder, datenominee, dateend As String

Dim custrow, lastrow As Long
With Sheet1
lastrow = .Range("A2000").End(xlUp).Row
pdftemplatefile = .Range("D3").Value
savepdffolder = .Range("D5").Value


Application.Wait Now + 0.00002

For custrow = 8 To 8
datenominee = .Range("A" & custrow).Value
dateend = .Range("B" & custrow).Value
Application.SendKeys "{Tab}", True
Application.SendKeys datenominee, True
Application.Wait Now + 0.000005


Application.SendKeys "{Tab}", True
Application.SendKeys .Range("B" & custrow).Value, True


'so forth and so on for all fields


Next custrow
End With
End Sub

 

 
 

 

 

TOPICS
Edit and convert PDFs , How to , PDF forms

Views

412

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 23, 2020 Nov 23, 2020

Copy link to clipboard

Copied

LATEST

You need to split the value into indivdual characters using the SPLIT method, or access them one at a time, using the MID function.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines