+ Reply to Thread
Results 1 to 5 of 5

Enabled Macros to disabled copy paste but could just ignore Macros to enabled back

  1. #1
    Forum Contributor
    Join Date
    05-10-2019
    Location
    Penang, Malaysia
    MS-Off Ver
    2016
    Posts
    176

    Enabled Macros to disabled copy paste but could just ignore Macros to enabled back

    Hi All,
    I have found VBA code from (https://www.extendoffice.com/documen...opy-paste.html) to disabled copy paste, its working fine for a security reason.
    However, if I just ignore to enable macros, I am are able to use copy paste which I feel not really secured. Any idea how to prevent this?

    Please find attachment. Your help is greatly appreciated.

    Thank-You very much
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    32,518

    Re: Enabled Macros to disabled copy paste but could just ignore Macros to enabled back

    Excel is not a secure environment.

    The only way to ensure that people enable macros and, therefore, your restrictions is to make the workbook unusable without enabling macros.

    It's not a simple task although it is doable. You need to research excel vba force macro enabled
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    12-20-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    88

    Re: Enabled Macros to disabled copy paste but could just ignore Macros to enabled back

    I have a sheet that I think does what you are asking. it forces users to enable macros to continue and requires a worksheet named START that tells the user to enable macros to continue. it also makes sure they save it as a macro enabled sheet. Put this code ThisWorkbook.
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    05-10-2019
    Location
    Penang, Malaysia
    MS-Off Ver
    2016
    Posts
    176

    Re: Enabled Macros to disabled copy paste but could just ignore Macros to enabled back

    Hi TMS, jamfz,
    Thanks for your help.

    I have found simpler code to force enabled macros when opening worksheet.
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    HTML Code: 
    'Step 1: Declare your variables
      Dim ws As Worksheet
    'Step 2: Unhide the Starting Sheet
      Sheets("START").Visible = xlSheetVisible
    'Step 3: Start looping through all worksheets
      For Each ws In ThisWorkbook.Worksheets
    'Step 4: Check each worksheet name
      If ws.Name <> "START" Then
    'Step 5: Hide the sheet
      ws.Visible = xlVeryHidden
      End If
    'Step 6: Loop to next worksheet
      Next ws
    'Step 7: Save the workbook
      ActiveWorkbook.Save
    End Sub

    I will close this thread & mark to SOLVED.

    Thank-You very much
    Attached Files Attached Files

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    32,518

    Re: Enabled Macros to disabled copy paste but could just ignore Macros to enabled back

    You're welcome. Thanks for the rep.


    Glad you found a solution that works for you.

+ 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. Workbook opens with macros enabled despite being disabled in settings
    By dgarber in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2019, 02:06 AM
  2. All Macros Are Enabled, But Macros Are Still Not Running
    By chasfh in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 06-04-2019, 07:23 AM
  3. Replies: 0
    Last Post: 06-09-2015, 09:30 PM
  4. How do I Disable Macros on a File where Macros were Previously Enabled?
    By Alves76 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2013, 10:26 AM
  5. Macros enabled workbook keeps saying macros are disabled
    By joker3 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-15-2013, 11:28 PM
  6. [SOLVED] choose default macros Not Enabled / Macros Enable Setting
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2006, 08:10 AM
  7. [SOLVED] Copy enabled / Pasted disabled
    By Ben in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-30-2005, 07:10 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