Announcement

Collapse
No announcement yet.

Workbook with VBA & Macro to activate Enable Macro on open workbook

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Workbook with VBA & Macro to activate Enable Macro on open workbook

    Hi All,

    I have a workbook with macros and vba code. Now is it possible to check and prompt the user to enable macros when they open this workbook if its not already enabled?

    Maybe a prompt to click yes to enable both macros and trust all vba content???


    I am using office 2010.

    Thank you all.

  • #2
    Re: Workbook with VBA & Macro to activate Enable Macro on open workbook

    Anything on this guys?

    Thank you.

    Comment


    • #3
      Re: Workbook with VBA & Macro to activate Enable Macro on open workbook

      Anyone please?

      Comment


      • #4
        Re: Workbook with VBA & Macro to activate Enable Macro on open workbook

        The basic conundrum is that if macros are disabled, no macro can run to check/force the user to enable them beforehand... you're left with the 'standard' Excel warnings about macros and relying on the user to make the proper choice.

        There are ways around this, but they all rely on hiding the sheets leaving only a basic 'introduction' sheet if the user has not enabled macros. There is a discussion about it somewhere on this board, but I can't find it at the moment (perhaps you'd like to try searching?) or you can have a read of this - http://www.cpearson.com/excel/EnableMacros.aspx

        Comment


        • #5
          Re: Workbook with VBA & Macro to activate Enable Macro on open workbook

          Thanks cytop.

          I have already looked at that but was wondering if there was any other way of switching it on through one click button for example without going to options.

          Thanks for your help though.

          Comment


          • #6
            Re: Workbook with VBA & Macro to activate Enable Macro on open workbook

            Sorry for the very late reply, but here is my solution. It compares the result of a simple UDFunction Plus (simple addition) to that of the +-operator.
            I use the TODAY() function because it is volatile and gets updated immediately on opening.
            If macros are not enabled an error message emerges to remind you.
            My first contribution to this great forum, hope it is still usefull
            Attached Files

            Comment


            • #7
              Re: Workbook with VBA & Macro to activate Enable Macro on open workbook

              Another great option is to have a main sheet with the message "Please enable macros" on it. Have all the other sheets hidden on startup. Create a Macro on Workbook Open that hides the Main sheets with the message to enable macros and unhides the others worksheets . That way the only way to use the files is to enable macros.

              Comment


              • #8
                Re: Workbook with VBA & Macro to activate Enable Macro on open workbook

                Agreed, that's a better solution - and by far more elegant

                Comment

                Working...
                X