none
Checking if Macros Are Enabled RRS feed

  • Question

  • Hi

    I know I am going to open myself up to a little "ribbing" with this question but here goes.

    I have a number of macros in MS Project files that MUST be enabled.  Is there a way to check if macros are enabled when opening an MS Project file even if macros are currently disabled on the users machine?

    Look forward to the "ribbing" and and valid suggestions :-)

    Thanks

    Tony


    TKHussar

    Wednesday, November 30, 2016 12:45 PM

Answers

  • Add-ins will still work with macros disabled. There's a separate setting in the Trust Center to disable add-ins but it's less noticeable than the macros setting.
    • Marked as answer by TKHussar Thursday, December 1, 2016 4:33 PM
    Thursday, December 1, 2016 2:15 PM
  • Tony,

    Is there a way? Sure, there is probably always a way to hack into the system and override something but I certainly don't know how to do it.

    Just think for a minute. The whole reason the option to ignore or allow macros is at application level and not available to change through code, is to protect the user from having to worry about nefarious macro code executing on his/her PC.

    If your macros MUST be enabled, your course of action is to insure the user has the option set to allow macros.

    John

    • Marked as answer by TKHussar Wednesday, November 30, 2016 2:14 PM
    • Unmarked as answer by TKHussar Wednesday, November 30, 2016 2:14 PM
    • Marked as answer by TKHussar Wednesday, November 30, 2016 2:15 PM
    Wednesday, November 30, 2016 2:13 PM

All replies

  • Tony,

    Is there a way? Sure, there is probably always a way to hack into the system and override something but I certainly don't know how to do it.

    Just think for a minute. The whole reason the option to ignore or allow macros is at application level and not available to change through code, is to protect the user from having to worry about nefarious macro code executing on his/her PC.

    If your macros MUST be enabled, your course of action is to insure the user has the option set to allow macros.

    John

    • Marked as answer by TKHussar Wednesday, November 30, 2016 2:14 PM
    • Unmarked as answer by TKHussar Wednesday, November 30, 2016 2:14 PM
    • Marked as answer by TKHussar Wednesday, November 30, 2016 2:15 PM
    Wednesday, November 30, 2016 2:13 PM
  • Hi John

    I guessed that would be the answer.  Many thanks for your response.

    Kind regards

    Tony


    TKHussar

    Wednesday, November 30, 2016 2:16 PM
  • You could make the macros into an event-driven add-in. As long as the add-in is installed, it will run when Project runs. The user will still be able to disable the add-in but that won't happen by default.
    Wednesday, November 30, 2016 2:27 PM
  • Tony,

    You're welcome and thanks for the feedback. It looks like you were a little indecisive about my answer though.

    One more thought on this subject. If you are working for someone as a consultant, and are concerned about having your client's trust, nothing will destroy that trust quicker than having covert macro code run on his/her system. The code may be harmless but good due diligence says being upfront is the best approach. In any macro I write for someone, the first thing the macro does is to display a message telling the user the name of the macro, the version and text explaining what the macro is going to do.

    John

    Wednesday, November 30, 2016 3:44 PM
  • Hi John

    Thanks for your response.  Basically I have written a suite of Macros that totally automates reporting from multiple Projects Plans as long as those plans are correctly configured.  However for those reports to work correctly macros always need to be enabled.  One of the macros prevents the removal or change of certain activities that are reported on at Programme Level such as Payment Milestones.  We have an issue where people are manually changing dates to suit their own needs.

    Thanks again.

    Tony


    TKHussar

    Thursday, December 1, 2016 8:47 AM
  • Hi Bill

    Do we still not need macros enabled in order to switch on the event handler?

    Look forward to hearing from you.

    Kind regards

    Tony


    TKHussar

    Thursday, December 1, 2016 8:48 AM
  • Add-ins will still work with macros disabled. There's a separate setting in the Trust Center to disable add-ins but it's less noticeable than the macros setting.
    • Marked as answer by TKHussar Thursday, December 1, 2016 4:33 PM
    Thursday, December 1, 2016 2:15 PM
  • Thanks Bill.

    TKHussar

    Thursday, December 1, 2016 4:33 PM
  • Tony,

    Yes, I understand that but there should be no reason to not ask the user to allow macros to run. If they are opposed to that then you need to have a conversation with their management and point out the benefits your macros have on your client's operation.

    It sounds like Bill gave you an approach using an add-in. You may or may not be aware that the Project security setting is accessible in the Windows Registry and you can find APIs that will read Registry values and potentially allow them to be changed.

    John

    Friday, December 2, 2016 2:34 PM