+ Reply to Thread
Results 1 to 2 of 2

Macros don't run with protected sheet

  1. #1
    Registered User
    Join Date
    11-13-2013
    Location
    Mexico
    MS-Off Ver
    Excel 2007
    Posts
    1

    Exclamation Macros don't run with protected sheet

    Hi everyone.

    I'm new on this site, I registered a few mins ago so this is my first post/question, I hope someone can help me on this. I'm new to Macros, and VBA etc, so I hope to ask in a understandable way for you guys.

    Long story short, I created this excel project on which I have added different macros for different functions. I do not know how to program on VBA (although it looks kinda similar to GWBasic, if you know what I mean), so all I have done is "copy" and "paste" the codes from the internet for the functions I want on my excel proect, and everything has worked really great.

    Until I password-protect the sheet.

    I've read a lot of different posts on different sites and basically, I've tried everything! Everything and each and every single time I protect the sheet, no matter what codes I have used, I still can't make macros to run under the protected sheet...

    Every time I get this error message. Something about "1004" and when I click the button to go to the VBA editor (my excel is in Spanish 'cause I'm Mexican (no beaner or green cards jokes here please thanks ) it highlights in yellow background different things. Sometimes it shows me a Range, sometimes an ActiveCell, etc.

    So, my question is: Is there a way to ACTUALLY password-protect your sheet to prevent users to modify or delete formulas etc. AND make all the macro's work still, without seeing that runtime 1004 error or something?

    ANY ideas on this will be HIGHLY appreciated.

    Greetings from Mexico, and sorry'bout my English and long post!

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Macros don't run with protected sheet

    Hi, Juan Carlos,

    you might use the approach to unprotect the sheet, run the code and protect the sheet again at the end.

    Another way would be to use the parameter UserInterfaceOnly:=True which is volatile but would allow all macros to run while any user canīt change the data. This command will not be saved with the workbook and needs to be set on opening the workbook or activating thesheet.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine 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. [SOLVED] Way to Get Around Macros Not Working in Protected Sheet?
    By lyndy256 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2013, 10:12 PM
  2. [SOLVED] Using Macros on protected sheet
    By Bakar in forum Excel General
    Replies: 1
    Last Post: 09-30-2012, 09:34 AM
  3. Get macros to work on protected sheet
    By howsitgoing in forum Excel General
    Replies: 4
    Last Post: 01-12-2012, 02:10 PM
  4. Enabling macros while the sheet being protected !
    By dinesh in forum Excel General
    Replies: 13
    Last Post: 09-27-2005, 03:47 PM
  5. [SOLVED] is it possible to use macros when the sheet is protected
    By Dajana in forum Excel General
    Replies: 1
    Last Post: 09-22-2005, 11:05 PM

Tags for this Thread

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