I have to copy a table in html format to paste in Gmail body. Sometimes I get the error "Pastespecial error or Rangeclass failed". I am not able to figure it when and why this is happening as it doesn't give this error always. The code run again in the evening and sometime gives Pastespecial error in the morning. I have attached my code.