+ Reply to Thread
Results 1 to 3 of 3

Close Workbook if Macros not enabled

Hybrid View

  1. #1
    Graham Fowler
    Guest

    Close Workbook if Macros not enabled

    Hi Group
    Is it possible to close a workbook if the user does not enable macros. If
    so, how would this be achieved? Any help would be very much appreciated as
    it is important that my user cannot bypass enableing macros.
    Many thanks
    Graham



  2. #2
    JE McGimpsey
    Guest

    Re: Close Workbook if Macros not enabled

    It's not possible, since macros would have to be enabled to automate
    closure.

    What is often suggested is to have all sheets hidden except a "splash"
    sheet, saying "you must enable macros to use this workbook." You could
    then use a Workbook_Open() event to unhide the working sheets and hide
    the splash sheet. Use a Workbook_BeforeSave macro to unhide the splash
    sheet, hide the working sheets, save the file, then reverse the process
    again. You can set the visibility of the working sheets to xlVeryHidden
    to prevent them from being listed in the Format/Sheet/Unhide dialog.

    Note that this will only be a convenience to your users, not provide any
    real security. Anyone with enough ability to find these newsgroups will
    be able to find ways to bypass your protection scheme.





    In article <[email protected]>,
    "Graham Fowler" <[email protected]> wrote:

    > Is it possible to close a workbook if the user does not enable macros. If
    > so, how would this be achieved? Any help would be very much appreciated as
    > it is important that my user cannot bypass enableing macros.


  3. #3
    Andrew
    Guest

    Re: Close Workbook if Macros not enabled

    protect the Splash Sheet which tells the user that macros must be enabled &
    Set other Sheets to xlSheetVeryHidden
    then try this macro...

    Private Sub Workbook_Open()
    ' this activates if macro's Enabled..!
    ' otherwise only splash screen Visible
    For Each sh In Sheets
    sh.Visible = True
    Next sh
    Sheets("Sheet1").Visible = xlVeryHidden ' Hide Splash Sheet if macro's
    Enabled
    End Sub


    HTH
    Andrew

    "Graham Fowler" <[email protected]> wrote in message
    news:[email protected]...
    | Hi Group
    | Is it possible to close a workbook if the user does not enable macros. If
    | so, how would this be achieved? Any help would be very much appreciated as
    | it is important that my user cannot bypass enableing macros.
    | Many thanks
    | Graham
    |
    |



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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