ViewCollapseAll on embedded single-category view - any workaround or fix?

Like some others on this forum, I need to collapse a view when it opens, when embedded in a form using the Show Single Category feature.

In the past putting a ViewCollapseAll in the view’s PostOpen event would do this, but since the introduction of 8 this no longer works. It generates a “Cannot execute the specified command” error.

Does anyone know of a fix or workaround? TIA…

Keith