Before printing any section in spreadshit document check than one will be placed in same page. For that use function CheckPut(in Your case) and CheckAttachment. If this function return false then use PutHorizontalPageBreak and put the Logo section after that an continue outputing other section in you'r cicle