+ Reply to Thread
Results 1 to 6 of 6

Require Users to Enable Macros

  1. #1
    Registered User
    Join Date
    10-06-2011
    Location
    Everett, WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Question Require Users to Enable Macros

    My thread on protecting data validation from being overwritten was solved, for which many thanks. But I now find that it only works if macros are enabled. Company policy is that they must be manually enabled when a workbook is opened. If macros are not enabled, the data validation can still be overwritten by the users, and will be, almost invariably.

    So is there a way to not let them work on this workbook until/unless macros are enabled?

    Thanks in advance.

  2. #2
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: Require Users to Enable Macros

    Hey Dairy_Queen.

    Kind of... I had a similar problem.

    What I did was create a splash page that people hit before they get to the actual data within the book, explaining how to enable macros. Every worksheet of the workbook was hidden, password protected, and locked down. The VBA was also password protected, so they couldn't get at the obvious password that way either.

    Then just had a huge button, that just did a VBA script to unlock, unhide all of the worksheets within the workbook, and allow the user to get to the data as per normal excel.

    What you need to remember to do is before each save (upon save event), to revert it back to it's 'locked' state, so that whomever next opens the book has to go through the same enabling of macros, etc.
    Going for Guru! Click the Star to the bottom left of this post if I helped!

  3. #3
    Registered User
    Join Date
    10-06-2011
    Location
    Everett, WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Require Users to Enable Macros

    OK, many thanks. It appears to be a problem not responsive to subtle hints, I gather -- no surprise.

    My last day on this contract is Friday, and I'm new to using VBA. Would you feel able to post the scripts and more detailed instructions; I'm running out of time and would so love to really "nail" this assignment.

    Thank you in any case.

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Require Users to Enable Macros

    HTH
    Regards, Jeff

  5. #5
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: Require Users to Enable Macros

    Please Login or Register  to view this content.
    I removed some irrelevant stuff from there... but that gives you an idea.

    In the ThisWorkbook code:
    Please Login or Register  to view this content.
    Hope that works... or at least helps.

  6. #6
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: Require Users to Enable Macros

    Jeff's link code looks like it may work better?
    Might be more robust?

    May be overkill... I dunno, I didn't want to look into it too deeply. But either way, you should be set.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1