See, you have provided almost close to zero information for debugging and expecting a solution.
1. What are you actually trying to do.
2. What is the error message you get?
3. What values of variables $htmlReport,$xlHTML..
What can one make out from a few lines from the middle of the code. It will not help. So provide sufficient infomation.
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.