Cannot output to stream 'X'.

#6097   Run-time catchable error

Cannot output to stream 'X'.

Additional Information

The stream is currently not open.

Explanation

A user-defined stream can only be written to after opening or reopening it and before closing it.