I am using the following code (help received from @Tanaike, @Rafa Guillermo) to generate a PDF of my sheet from which this function is triggered in turn the PDF is emailed with