Replace sheet format macro not updating title block

I'm new to Solidworks, and am trying to assist another team in mass-updating sheet formats. When doing it manually, everything is updating as expected.

When using this macros however, the title block does not get updated: https://www.codestack.net/solidworks-api/document/drawing/replace-sheet-format/

 

 

If I run the macro then click "Edit Sheet Format" and click it again to cancel editing, the title block is updated and the old one goes away.

What can I change to the macro so that the title block is automatically updated?