Skip to main content
Participant
April 19, 2020
Question

Checkbox set in vba not set on reopen of form

  • April 19, 2020
  • 2 replies
  • 779 views

Hello I am setting these checkboxes programmatically in Excel  and on first pass they are set. However when I reopen the document after saving they are not set. I was wondering is there a way  to set them and keep them set the way I programmed them to be.

 

Code adapted from:

https://myengineeringworld.net/2013/10/read-and-write-pdf-forms-from-excel-vba.html

 

'All checkboxes to checked
objJSO.GetField(strFieldNames(22)).Value = 1
objJSO.GetField(strFieldNames(23)).Value = 1
objJSO.GetField(strFieldNames(24)).Value = 1
objJSO.GetField(strFieldNames(25)).Value = 1
objJSO.GetField(strFieldNames(26)).Value = 1
objJSO.GetField(strFieldNames(27)).Value = 1
objJSO.GetField(strFieldNames(28)).Value = 1
objJSO.GetField(strFieldNames(52)).Value = 1

This topic has been closed for replies.

2 replies

Participant
May 7, 2020

It was the write section. To resolve the problem I recreated the form and that eliminated the issue. I was using the form straight from the VA.

ls_rbls
Community Expert
Community Expert
May 8, 2020

Hey that's great!

 

Thanks for sharing your feedback.

 

Don't forget to mark your answer as correct.

ls_rbls
Community Expert
Community Expert
April 19, 2020

 

It would be helpful if you specify which part of the macro is this.

 

According to the the link where you grabbed  the code from there are two codes; One is for reading the PDF the other one is for writing to the PDF.

 

So when you say the first pass, does this mean that the ReadPDF portion of the code works but not the WritePDF code?