Skip to main content
Participant
Apr 19, 2020 12:00 AM UTC
Question

Checkbox set in vba not set on reopen of form

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 is closed to new replies. Start a new post to keep the conversation going.

3 replies

Participant
May 7, 2020 11:32 PM UTC

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.

Translate
ls_rbls
Community Expert
Community Expert
May 8, 2020 12:45 AM UTC

Hey that's great!

 

Thanks for sharing your feedback.

 

Don't forget to mark your answer as correct.

Translate
Technical Generalist
ls_rbls
Community Expert
Community Expert
Apr 19, 2020 8:39 PM UTC

 

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?

Translate
Technical Generalist