using (clsExcel myExcelObj = new clsExcel()) { // Automation code goes here }This will limit the lifetime of the myExcelObj so that its resources are released at the end of the using block instead of waiting for garbage collection to take care of it at some indeterminate time in the future. I don't know if there is an equivalent command in VB.