If you were working as a manager, the company entrusted you to do your job whatever way you wanted as long as it did not violate any company policy.
If a manager during his period of employment have created a procedure that contributed to the productivity of his department, the company has the right to keep that procedure even after the manager decided to leave the company, and even if the manager developed the "idea" while spending time at home. But if such procedure is done by the manager himself, (meaning, he does it without the involvement of anybody in the company) he doesn't have the obligation to turn it over to somebody else in that company.
The same thing applies to a program created by a manager. If one of his staff uses that program for their department's use, he cannot take it away from the company. But if he himself was the only user of the program he made (to perform his task effectively), he has no obligation to turn it over to the company. There are some exceptions though, like if he is going to turn over records of his projects done. And the only way to retrieve those records is to use his program.