+ Reply to Thread
Results 1 to 5 of 5

Close if macros disabled

  1. #1
    Registered User
    Join Date
    08-04-2008
    Location
    Blackpool
    Posts
    22

    Close if macros disabled

    Hoping this is an easy one, but i did a bit of a search and couldn't find a solution.

    Is it possible to force an excel file to close if someone disables macros?

    I have a file that runs a macro on open that will only display sheet tabs assigned to a specific person. However if they disable macros they can see everything... i figure easiest way to stop them is when they click "disable" it pops up saying workbook must run macros and will now close.


    Does that sound feasible, or will the macro making it do that not run when they disable it?


    Cheers in advance for any code/help/suggestions/roasted peanuts!

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Is it possible to force an excel file to close if someone disables macros?
    The answer is no. However these links may help encourage users to enable them

    http://www.vbaexpress.com/kb/getarticle.php?kb_id=379
    http://www.cpearson.com/excel/EnableMacros.aspx

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    08-04-2008
    Location
    Blackpool
    Posts
    22
    Quote Originally Posted by VBA Noob View Post
    The answer is no. However these links may help encourage users to enable them

    http://www.vbaexpress.com/kb/getarticle.php?kb_id=379
    http://www.cpearson.com/excel/EnableMacros.aspx

    VBA Noob
    Thx, will give those a try, although I may not be able to use them, as already have a macro in place that opens them on their personal page.

    Out of curiosity, if they hit disable when prompted if they want to run the macro or not, wouldn't that prevent the sheets from being hidden (with the exception of the one that prompts for enabling the macro)?

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon Thanatos

    I have a template available that is designed to be used by multiple users. On opening the file a user is prompted for a username and password. Once validated, the user is only allowed to see sheets that the administrator has allowed. The administrator can see all sheets and assign read only / read-write access for any sheet for any user.

    Obviously, this file needs to be opened with macros enabled, and the technique employed is similar to those detailed in the links that Noob has provided you with. The macros in this sheet are completely unprotected - if you would like a working example of how I achieved it, PM me your e-mail address and I'll forward the file on to you.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Quote Originally Posted by Thanatos View Post
    I may not be able to use them, as already have a macro in place that opens them on their personal page.
    Not sure what you mean?

    Out of curiosity, if they hit disable when prompted if they want to run the macro or not, wouldn't that prevent the sheets from being hidden (with the exception of the one that prompts for enabling the macro)?
    You would hide the sheets first. If they disable macro they see the prompt screen. If they enable macros then the macro unhides them all.

    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 06-17-2012, 02:24 PM
  2. Security Warning (Macros have been disabled)
    By asdvender in forum Excel General
    Replies: 10
    Last Post: 11-01-2008, 01:59 PM
  3. Disable or remove macro's on close
    By richardeallen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2008, 10:44 AM
  4. Macros Disabled ?
    By khalid79m in forum Excel General
    Replies: 2
    Last Post: 02-21-2008, 10:57 AM
  5. Close Excel if macros not enabled
    By philbennison in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-13-2007, 10:29 AM

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