I was unable to attach the files - Looks like the upload file feature has been disabled
Since I can't see the form, I'm just guessing: The problem might be in your condition. Are those rows named rowCE1, rowCE2, etc.? Or are they actually all named rowCE, and they have an index behind them?
If looking at that doesn't help, would you paste a screenshot of your hierarchy in a reply for us? That lets us see the names of fields and the path to them. Also, include the script window in your screen shot, if possible, so we can look at the event that is supposed to trigger the script.
I wonder if you've got a race condition here. As the first few if statements are being processed, the objects in the conditions haven't been initialized, yet, so it doesn't know what to do with them thus making the condition false. And by the time it gets to the regular statement at the end, the subform HAS been initialized, so it can make it hidden. If statements are certainly processed in the initialize event; though, I have never tried to use one in the initialize for the form itself.
I might recommend you put this in the layout:ready event for your form, but be aware that the form itself reports back that the layout is ready A LOT! So, this might harm the performance of your PDF.
As a test, I was able to get a form to do what you're asking, but there are only two objects in the form. a checkbox and a subform. After that test, I really feel that the issue is with how much you are having to do in your form to initialize and whether all of the objects have been loaded before your form starts going through your script.