This short article shows you a solution to resolve the error “Microsoft Office Document Customization This document contains custom code that cannot be loaded because the location is not in your tn_lsted locations lists” when you are developing Excel using VSTO.
When you click Start to run your Excel project in Visual Studio then you might hit the following error.
1. Open Excel outside Visual Studio. Click File.
2. Click on Trust Center then choose Trust Center Settings…
3. Click on Trust Location and choose Add new location… to add the location your Excel solution is located.