+ Reply to Thread
Results 1 to 9 of 9

UserInterfaceOnly issue - protected Sheet

  1. #1
    Registered User
    Join Date
    08-08-2014
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    31

    UserInterfaceOnly issue - protected Sheet

    Hello everyone

    I need help with my workbook, i'm not entirely sure this problem wasn't posted before but I didn't find a solution to this.

    I have a workbook with 6 sheets and only the first sheet is addressed to normal users, they have to input data in a questionnaire that has drop down lists etc.
    What I need is to be able to run macros while sheet1 is protected. After a high user uprotects the sheet there is no need for anything else.

    But i am not able to make it run, i get the error 1004.

    The problem is that if I use Sheet1.Protect UserInterfaceOnly:=True it prompts me for a password, and I don't need this, because only a high user can unprotect the sheet and he already knows the password - so I need it to run but without prompting the user for a password.

    Is this even possible? Or is there any other way to do this?
    I need this first sheet to be protected - when the normal user inputs data, and unprotected when the high user uses it to modify data.


    I already tried it in Workbook Open but it doesn't work as I need it to work.

    any help would be greatly appreciated.
    Thanks

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: UserInterfaceOnly issue - protected Sheet

    As i understand, you are not the "high user". Are you?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    08-08-2014
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    31

    Re: UserInterfaceOnly issue - protected Sheet

    I created the workbook, so... yes, I am

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: UserInterfaceOnly issue - protected Sheet

    Alina.

    Then 1 way should be something like this.


    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-08-2014
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    31

    Re: UserInterfaceOnly issue - protected Sheet

    that's what i'm trying to avoid, because if the code is interrupted the worksheet could be left unprotected.

  6. #6
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: UserInterfaceOnly issue - protected Sheet

    this piece of code provided by Fottis works very well in many cases, it depends of yr needs. the best way is to attach a test file, without yr sensitive data and perhaps you'll rcv the help you are after to!
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  7. #7
    Registered User
    Join Date
    08-08-2014
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    31

    Re: UserInterfaceOnly issue - protected Sheet

    ok. But i have one question, until we get to the point of transmitting the workbook.

    If I put in the Workbook Open Event the following code it prompts me for password when i open the Workbook, which is not what I need. I need to use the "protect/unprotect" button on the ribbon manually.

    Private Sub Workbook_Open()

    Sheet1.Protect UserinterfaceOnly:=True, AllowFormattingRows:=True

    End Sub

    isn't this how I should write the code?

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: UserInterfaceOnly issue - protected Sheet

    Supply the password in the code when you protect using Userinterfaceonly.
    Remember what the dormouse said
    Feed your head

  9. #9
    Registered User
    Join Date
    08-08-2014
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    31

    Re: UserInterfaceOnly issue - protected Sheet

    thanks a lot. Now it's working.

+ 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. Changing Locked property of cells in Protected sheet with option UserInterfaceOnly=True
    By MathUKTeacher in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2014, 07:34 AM
  2. [SOLVED] UserInterfaceOnly Issues....new issue (I think)
    By Littlenuts in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-31-2014, 06:32 AM
  3. [SOLVED] AllowFormattingCells not working on Protected sheet with UserInterfaceOnly
    By KL591 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2012, 10:07 AM
  4. Macro doesn't work on UserInterfaceOnly-protected sheet
    By Kasama in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-08-2006, 05:25 AM
  5. Replies: 2
    Last Post: 06-06-2006, 11:20 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