Everything works

The code opens the sheet then creates data from getActiveRange as two lines. For some reason the single line fails. The table was updated as well.