Jose, your write_out_dl21() function does not do anything at all with Excel, xlswrite1(), or ActiveX. So we can't debug it.
Does "inner_oslofjord_1_udp_ALL_EN_OUT.xlsx" exist already, or not? If it exists, please attach it.
See my Excel ActiveX demo - maybe that will help you.