Section 117. If the officer has, before such demand, sold on execution the personal property attached or a right of redeeming land attached as aforesaid, he shall not be a trespasser, but shall be liable only for the proceeds of the sale after deducting his legal fees and charges for attaching, keeping and selling the property attached. Such proceeds may be recovered by the executor or administrator in a civil action.