This works. require "luacom" excel = luacom.CreateObject("Excel.Application") excel = nil collectgarbage('collect') os.exit() Doing the close method (if it ever has one) without setting the object to nil and then collectgarbage does not work.