+ Reply to Thread
Results 1 to 9 of 9

Excel 2013, Macros won't run when sheet is protected

Hybrid View

  1. #1
    Registered User
    Join Date
    02-20-2014
    Location
    UK
    MS-Off Ver
    Excel 2016
    Posts
    39

    Excel 2013, Macros won't run when sheet is protected

    Hi everyone,

    Our users here have an Excel workbook which I've created - it relies heavily on macros but they don't seem to work when the document is protected (requiring a password to edit) and the user is on Excel 2013.

    Excel 2010 users can use the macros regardless of whether or not the document is protected.
    Excel 2013 users can use it provided the document is not protected.

    Is this a known problem?


    The error message thrown up is:

    Cannot run the macro "macroname". The macro may not be available in this workbook or all macros may be disabled

    Thanks in advance

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Excel 2013, Macros won't run when sheet is protected

    That message suggests that the users have different Excel Application setting for Macros and it's probably coincidence that you think 2010 is OK but 2013 isn't.
    That message will appear as far as I am aware in all versions if the macro settings are not right

    Look in Excel Options Trust Center, Trust Center Settings, Macro Settings. Make sure the user know to click on the 'Enable Macros' if prompted.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-20-2014
    Location
    UK
    MS-Off Ver
    Excel 2016
    Posts
    39

    Re: Excel 2013, Macros won't run when sheet is protected

    Hi Richard,

    I've been on the user's machine myself and have enabled Macros for the workbook. I've also tried setting Excel to enable all Macros and reopened the workbook. Finally I tried resaving the workbook and then opening it again, it works fine until protection is applied and that stops working.

    That said, it may be the case that it isn't a 2013 exclusive problem - we don't have many here that have upgraded and it was the one notable feature I could find with that user.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Excel 2013, Macros won't run when sheet is protected

    Hi,

    Are we talking workbook protection or worksheet protection?

    If workbook are you saying that on opening you choose to enable macros, and then enter the password but you then can't get macros to run?

  5. #5
    Registered User
    Join Date
    02-20-2014
    Location
    UK
    MS-Off Ver
    Excel 2016
    Posts
    39

    Re: Excel 2013, Macros won't run when sheet is protected

    When the file was saved, I went into Tools > General options and then set a password to modify.

    After doing this, the user was unable to use macros anywhere in the workbook even after entering the correct password to edit the file. She was also unable to use macros when the file was in read only mode.

    I was able to use macros on the same file (it's stored on our intranet) from my computer and another user with Excel 2010 was able to use them on his too.

  6. #6
    Registered User
    Join Date
    02-20-2014
    Location
    UK
    MS-Off Ver
    Excel 2016
    Posts
    39

    Re: Excel 2013, Macros won't run when sheet is protected

    Steps I've taken since Friday (original user = "User X"):

    - Tested the problem on another machine with Excel 2013, all buttons worked fine on this user's machine even when the sheet was password protected



    - Changed the password on User X's machine, still didn't work.
    - Reset all Excel settings to default on User X's machine. No effect.
    - Signed in as a different user on User X's machine, buttons didn't work on that profile either

    - Ran a macro through the developer tab on User X's machine, this worked fine
    - Assigned the same macro to a button on User X's machine, the button did not work
    - Wrote a macro on her version of Excel, still could not assign it to a button.

    And still everything works when the password is removed from the sheet. Totally stumped. It's just the combination of her machine, a password being set and the macro being assigned to a button that stops it from working.

  7. #7
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Excel 2013, Macros won't run when sheet is protected

    I unprotect the Sheet while run the macro.
    Is this possible?

    HTML Code: 

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,985

    Re: Excel 2013, Macros won't run when sheet is protected

    Does it matter whether you use ActiveX or Forms buttons?
    Everyone who confuses correlation and causation ends up dead.

  9. #9
    Registered User
    Join Date
    02-20-2014
    Location
    UK
    MS-Off Ver
    Excel 2016
    Posts
    39

    Re: Excel 2013, Macros won't run when sheet is protected

    Sorry, when I said it was assigned to a button I meant a shape (just a standard rectangle).

    I've just found that the problem vanishes when the length of the title of the document is 31 characters or below... I haven't worked out why yet
    Last edited by EmmaO91; 07-01-2014 at 06:47 AM.

+ 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: 1
    Last Post: 12-29-2022, 05:39 AM
  2. Macros running slow in Excel 2013
    By lgolf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-09-2014, 12:56 PM
  3. Excel 2013 Opening in Protected View
    By hmjjohnson in forum Excel General
    Replies: 0
    Last Post: 04-07-2014, 11:08 AM
  4. Replies: 1
    Last Post: 04-05-2014, 01:09 AM
  5. [SOLVED] I cant see my macros Excel 2013?
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-06-2013, 03:47 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