Datafile must be created with worksheet or block or workbook as parent

I encountered this error when trying to complete a CSV upload:

What’s up with that?

This happens when you are editing a template and try to add a table with a CSV source, or change the source of an existing CSV-based table.
It is possible to include CSV in a template by starting from a workbook, adding the CSV table, and then saving the workbook as a template. However, to update the CSV, it will be necessary to create a new workbook from the template, change the CSV source, and then save the resulting workbook as a new template, which can replace the original.