I have a macro to delete all VBA code and modules. This macro works fine in excel 2003 but in 2010 it opens only in protected view and when i select edit option it throws error
"Excel 2010 Run time error 1004. Programatic access to visual basic project is not trusted"
Due to security reason i don't want to maunally check (enable) programatic access to vb project trusted.
This error doesn't pop up in excel 2003 than why it pop up in 2010. Below is the code
Dim VBComp As Object
Dim VBComps As Object
Set VBComps = ActiveWorkbook.VBProject.VBComponents ' this line throws error