Using Excel Data to Populate a PDF Form

jusand

New Member
Joined
Oct 8, 2020
Messages
1
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
I would like to know if this is possible.
I have a pdf form that I would like to populate if I enter info in one field. For example. If I enter the PO number, I would like for the rest of the eight fields to populate. I finally was able to get the form to pull up and populate but it only populates based on the row number. I dont need it to save or print because I have other things to do with the form before that. Any help would be appreciated! thank you!

here is what I have so far:

VBA Code:
Sub PDFTemplate()
Dim PDFFldr As FileDialog
Set PDFFldr = Application.FileDialog(msoFileDialogFilePicker)
With PDFFldr
    .Title = "Select PDF file to attach"
    .Filters.Add "PDF Type Files", "*.pdf", 1
    If .Show <> -1 Then GoTo NoSelection
    Sheet1.Range("N10").Value = .SelectedItems(1)
End With
NoSelection:
End Sub


Sub CreatePDFForms()
Dim PDFTemplateFile, NewPDFName, SavePDFFolder, PO As String
Dim Vendor As Name
Dim PORow, LastRow As Long
With Sheet1
LastRow = .Range("A9999").End(xlUp).Row 'Last Row
PDFTemplateFile = .Range("N10").Value 'Template File Name
ActiveWorkbook.FollowHyperlink "f:\APV.pdf"
Application.Wait Now + 0.00006

For PORow = 2 To 2 'LastRow
PO = .Range("A" & PORow).Value 'PO
Application.SendKeys "{Tab}", True
Application.SendKeys PO
Application.Wait Now + 0.00002

Application.SendKeys "{Tab}", True
Application.SendKeys .Range("B" & PORow).Value, True 'Vendor
Application.Wait Now + 0.00002

Application.SendKeys "{Tab}", True
Application.SendKeys .Range("E" & PORow).Value, True 'FM
Application.Wait Now + 0.00001

Application.SendKeys "{Tab}", True
Application.SendKeys .Range("C" & PORow).Value, True 'ID
Application.Wait Now + 0.00001

Application.SendKeys "{Tab}", True
Application.SendKeys .Range("I" & PORow).Value, True 'Account
Application.Wait Now + 0.00001

Application.SendKeys "{Tab}", True
Application.SendKeys .Range("D" & PORow).Value, True 'Organization
Application.Wait Now + 0.00001

Application.SendKeys "{Tab}", True
Application.SendKeys .Range("F" & PORow).Value, True 'FUNd
Application.Wait Now + 0.00001

Application.SendKeys "{Tab}", True
Application.SendKeys .Range("G" & PORow).Value, True 'ORG
Application.Wait Now + 0.00001

Application.SendKeys "{Tab}", True
Application.SendKeys .Range("H" & PORow).Value, True 'PROG
Application.Wait Now + 0.00001






Next PORow
End With
End Sub
 
Last edited by a moderator:

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Watch MrExcel Video

Forum statistics

Threads
1,129,580
Messages
5,637,214
Members
416,961
Latest member
sigrid6940

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top