help with excel macros(vb code) RRS feed

  • Question

  • hi

    I have an excel which has lot of macros written, now our security team has come back and reported the vulnerability since a tech savvy can modify or delete macros. So they suggested to lock down macros so that none of the user can even see it. Actually, I changed macros security by checking “Lock Project for viewing” in protection Tab which will lock down the macros, but the problem of this approach is that I need to maintain a password. Is there any other approach where I can lock down the macros in order to restrict the user to view . help will be really appreciated.

    Wednesday, June 6, 2018 3:26 PM

All replies

  • What is the problem with using a password for "security"?

    Wednesday, June 6, 2018 3:41 PM
  • Maintaining password is the problem.. who will maintain if I change the company :-)
    Wednesday, June 6, 2018 4:07 PM
  • Hello adushetty,

    As far as I know, there is no other way to protect the macro code from viewing. Since it is required by your company security team to protect the macro, I would suggest you tell the password to your company security team and make them maintain the password.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Thursday, June 7, 2018 8:07 AM
  • Thanks Terry, Security team told me that it's a weak mitigation plan. They were asking is there a way to separate macros from excel .I know that I can move those codes to visual Studio but as of now security team wants to mitigate this with very low cost. any help?
    Thursday, June 7, 2018 2:19 PM
  • Is there a way that I can write some code to lock down the macros either in main method or else in form load of the macros?
    Friday, June 8, 2018 1:30 AM
  • I suggest you move the VBA code to an XLAM addin and protect that.

    Charles Excel MVP The Excel Calculation Site

    Friday, June 8, 2018 1:33 PM
  • Tell the Security Team that from a business perspective there are three goals -- Quality, Speed and Low Price.  In the real world you only get two out of three. :)
    Friday, June 8, 2018 1:56 PM