+ Reply to Thread
Results 1 to 8 of 8

Using macros on a protected workbook

  1. #1
    Forum Contributor
    Join Date
    02-16-2016
    Location
    england
    MS-Off Ver
    11
    Posts
    115

    Using macros on a protected workbook

    Hi all,

    I have multiple macros on a workbook which I need to protect how do I enable the use of the macros whilst protected?

    D

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Using macros on a protected workbook

    In 'ThisWorkbook' module:
    (enabling the execution of macros on a secured workbook)
    Please Login or Register  to view this content.
    In module 'Module1' (at the top of module)
    (hiding the macro preview)
    Please Login or Register  to view this content.
    In editor vba (alt+f11), see image.
    (to protect macros from unauthorized browsing)
    Attached Images Attached Images

  3. #3
    Forum Contributor
    Join Date
    02-16-2016
    Location
    england
    MS-Off Ver
    11
    Posts
    115

    Re: Using macros on a protected workbook

    I'm not sure what I need to do here....?

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Using macros on a protected workbook

    1. open your workbook
    2. press alt+f11
    3. in the vba editor, in the left panel (Project - VBAProject) select the module "ThisWorkbook"
    4. paste the "Workbook_Open" procedure code here (with your own password)

    Optionally, in the 'Module1' module enter the 'Option Private Module' clause, to hide macros from prying eyes, as well as you can protect the vba editor using a password.
    Last edited by mjr veverka; 01-28-2018 at 02:33 PM.

  5. #5
    Forum Contributor
    Join Date
    02-16-2016
    Location
    england
    MS-Off Ver
    11
    Posts
    115

    Re: Using macros on a protected workbook

    Thanks got your help, works fine

  6. #6
    Forum Contributor
    Join Date
    02-16-2016
    Location
    england
    MS-Off Ver
    11
    Posts
    115

    Re: Using macros on a protected workbook

    Hi again,

    I thought this worked but it didnt, im really not getting it, this is my code what do i paste in and where?


    Sub reset()
    '
    ' reset Macro
    '

    '
    Cells.Select
    Selection.EntireRow.Hidden = False
    Range("D6").Select
    End Sub
    Sub search()
    '
    ' search Macro
    '

    '
    Cells.Select
    Selection.EntireRow.Hidden = False
    Range("D6").Select
    Calculate
    End Sub

  7. #7
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Using macros on a protected workbook

    And what exactly do you want to do (because you mark minimum millions of cells, and then you're trying to unhide minimum tens of thousands of rows) ?
    Please Login or Register  to view this content.
    Old excels = 16,777,216 cells = 65,536 rows x 256 columns
    New excels = 17,179,869,184 cells = 1,048,576 rows x 16,384 columns

  8. #8
    Forum Contributor
    Join Date
    02-16-2016
    Location
    england
    MS-Off Ver
    11
    Posts
    115

    Re: Using macros on a protected workbook

    Sorry for the late reply, thanks for yopu help - I saw my mistakes and took your advice in the size of the actions.

+ 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. [SOLVED] Allow to work Macros in protected workbook
    By Neilesh Kumar in forum Excel General
    Replies: 30
    Last Post: 05-12-2017, 08:26 AM
  2. [SOLVED] Macros do not run on protected workbook
    By Wesman55 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2015, 12:29 AM
  3. Getting Macros to Work with Protected Workbook
    By rachaelgoldman1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2013, 10:29 AM
  4. How to get Macros to work in a protected workbook
    By cmicoordination in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2013, 05:57 PM
  5. Macros not working in a protected workbook
    By Triscia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2013, 08:25 AM
  6. Run macros on a protected workbook
    By Kgbpizza in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2010, 02:59 PM
  7. Running Macros in protected workbook
    By petunia in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-18-2005, 06:06 PM

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