If the timbers in your roof need treatment please check first whether bats are present since some chemicals are extremely toxic to bats.
Once sprayed on the timbers the bats ingest the chemicals while they groom themselves.
Older chemicals such as Lindane leave a poisonous residue for some time so the bats may be killed even if they are not present during the treatment work.
Modern chemicals, such as permethrin or borax based treatments, are mostly less toxic to bats but treatment should never be carried out while the bats are present, so if you know that bats are present in the summer, for example, you should wait until you are sure they have left for the winter before you proceed with the treatment.
If you think bats use the building you can check this information from Natural England on products that are safe for use in a bat roost.