I consulted with some colleagues, and it turns out there is a WAY simpler method of doing this.

If you have a range of bars selected (shift+click to select multiple) when you are exporting, it will only export those selected bars. You'll know they're selected if they're highlighted in black.

So it was pretty fun getting creative to solve that issue in a weird way, but it was also totally unnecessary. Oh well, it's not about the destination, it't about the lessons we learn along the way, right?

Cheers